Query Oracle statements SAP Report

** Myself
For 4.6/4.7/ECC5 without dbacockpit
se38/sa38 -> rsoradjv



























->select * from dba_users      (Example)












ALV grid result




















For ECC6 without dbacockpit
st04->
 Performance->
   Additional Fn->
    SQL Command Editor









SELECTION 
Specify a SELECT statement which reads data of tables / views with owner SYS.
The syntax is as follows:
SELECT [ hint ] [ { DISTINCT | UNIQUE } | ALL ] select_list
FROM table_reference [, table_reference]...
[ WHERE condition ]
[ hierarchical_query_clause ]
[ group_by_clause ]
[ HAVING condition ]
[ { UNION | UNION ALL | INTERSECT | MINUS } ( subquery )]
[ order_by_clause ]

A hint is placed between "/*+" and "*/"

A select list has the following syntax:
{ * |
{[table_alias.]dbfieldname | expression} alias [

,[table_alias.]dbfieldname | expression} alias] ... }

An expression within this select list can be every form of calculation: +, -, *, /, ||. Also unary functions are allowed (LN, MIN, AVG ...)
Syntax for a table reference is:
{(select statement) [table_alias] | table [table_alias]}

All other parts of the syntax are according to the sql standard.

Some conventions and restrictions:
·  Each column that is specified in the select list will be a column in the output list
·  If a select list element is specified with an (column) alias, this alias will be used as header text in the output list. In the other case the program uses the field name of the select list element as header text. If a select list element is an expression (no data base field), the alias is obligatory.
==> IMPORTANT: For every expression that is no data base field use a
column alias!

·  Every column alias that is specified in the select list of a subquery can be used like a dbfieldname in the select statement.
·  If more than one table is specified in the from clause, the columns are matched to one table for reasons of unique-ness. If a column name occurs in more than one table unique-ness cannot be guaranteed. In this case you have to spacify a table alias before the column name (dbfieldname)!
==> IMPORTANT: When more than one table is specified, and column names
that have to be outputted occur in more than one table, use a table
alias!
STANDARD_VARIANTS 
OUTPUT 
The data is displayed in a table using the standard ALV grid control.
ACTIVITIES 
Edit statement within editor screen.
·  Parse the SELECT statement with "SQL Command -> Parse"
·  Parse and execute the SELECT statement with "SQL Command -> Execute" ==> The statement will be checked and executed; you finally get the result displayed in a ALV grid control as list.
·  Save the current SELECT statement with the button "Save as local file" to your frontend
·  Laod a (previous saved) statement with the button "Load a local file" from your frontend

0 comments:

Loading