Wie können wir Ihnen helfen?
< Zurück
Drucken

SapQuery

With a SapQuery, an OpenSQL query is executed against the database via the server module.

 

Attributes:

AttributeRequiredDescription
IdYes
Unique Id in the query tree
DependsOnNoOptional dependency on one another query node
SelectYes
Select part of the query
From
Yes
From part of the query
Where, GroupBy, Having, OrderByNoOptional parts of the query
QueryLimitNoLimit for the rows that applies to the execution of the SQL Statements. Is mapped to "UP TO" in OpenSQL.

Note: It is recommended to always set a low limit first, otherwise long query times could occur when more SapQueries follow in the execution tree.
ResultLimitNoLimit for the rows that applies to the execution of the node. No more queries will be run on the database once the node limit is reached.
Therefore, the maximum of rows returned is the number specified in ResultLimit.
ResultMappingNoList of target fields for the result columns from the Select. Is required, when
  • no Select is made on "*" or

  • SQL joins are used in the From attibute or

  • aggregate functions are used.

Optionally, the result column can be renamed with an alias.
Format:
Table~Column[~Alias]
ResultFilters NoList of result processing

 

As of Release 8, suxxesso Tool Suite supports queries in strict mode. This means that CDS views can now also be queried.

This strict mode syntax is expected by default for new queries. The most important difference is that for SAP queries in strict mode, the individual columns in the “SELECT” attribute must be separated by commas.

 

SAP queries from previous releases continue to work, as the “StrictMode: false” flag is automatically added when updating.

 

Syntax for queries with Flag “StrictMode: false”:
The syntax for the OpenSQL parts is limited to version 7.31. If elements of a newer syntax are used, the error message TS-40001 appears.

SELECT { * 
       | { {col1|aggregate( [DISTINCT] col1 )} [AS a1] 
           {col2|aggregate( [DISTINCT] col2 )} [AS a2]  ... } 
       FROM { { {dbtab [AS tabalias]} 
              | { [(] {dbtab_left [AS tabalias_left]} | join 
                      {[INNER] JOIN}|{LEFT [OUTER] JOIN} 
                      {dbtab_right [AS tabalias_right] ON join_cond} [)]} 
              [UP TO n ROWS] 
       WHERE sql_cond] 
       [GROUP BY {col1 col2 ...}|(column_syntax)] 
       [HAVING sql_cond] 
       [ORDER BY { {PRIMARY KEY} 
                 |{{{col1|a1} [ASCENDING|DESCENDING]} 
                   {{col2|a2} [ASCENDING|DESCENDING]} 
                   ... }
Inhaltsverzeichnis