Ansicht
Dokumentation
ABAPSQL_EXPR - SQL EXPR
Addresses (Business Address Services) General Data in Customer MasterThis documentation is copyright by SAP AG.
- SQL Expressions sql_exp
... sql_elem
$| sql_func
$| sql_arith
$| sql_cast
$| sql_string
$| sql_case
$| sql_agg
$| sql_win...
Effect
SQL expressions are expressions that generally can be specified in the following positions of statements:
- As columns specified in the SELECT list
- As arguments of certain aggregate expressions in the SELECT list and in the HAVING clause
- As operands of SQL conditions:
- On the left side of an SQL condition for statements
- On the left and right side of an SQL condition for expressions
- As a grouping criterion after GROUP BY
- As a window criterion after PARTITION
Some expressions, such as CAST expressions, can also be specified at other positions and built-in functions can be specified on the right side of SQL conditions for statements. This is documented for the respective positions.
SQL expressions are passed to the database system, executed there, and the result is passed to the AS ABAP if requested.
In general, the operands of SQL expressions can also be SQL expressions whose result must have a suitable data type. There are restrictions to individual operand positions, which are described for these.
The following SQL expressions exist:
Every expression can be enclosed in parentheses. The result of an expression is used in the statement in accordance with the operand position, with the data type in nested expressions based on the outermost expression.
Notes
- No alias names defined using AS can be used as operands of SQL expressions. This also means that none of the expressions used in a SELECT list can be specified as operands using their alias names.
- SQL expressions cannot currently be used together with the addition FOR ALL ENTRIES. An exception to this rule are individual columns and an individually specified aggregate expression COUNT( * ).
- Certain SQL expressions can be calculated in the table buffer. If the remaining SQL expressions are used, table buffering is bypassed.
- When SQL expressions are used other than for individually specified columns or individually specified aggregate expressions, the syntax check is performed in a strict mode as of Release , which handles the statement more strictly than the regular syntax check. If other SQL expressions are specified along with aggregate expressions or the addition GROUP BY, the syntax check is performed in strict mode as of Release . Using aggregate expressions as operands of SQL expressions results in the strict mode as of Release .
Example
Syntax example for specifying SQL expressions in different operand positions in a SELECT statement
PERFORM Short Reference General Material Data
This documentation is copyright by SAP AG.
Length: 6107 Date: 20240426 Time: 104304 sap01-206 ( 71 ms )