ABAP - Keyword Documentation →  ABAP - Reference →  Processing External Data →  ABAP Database Accesses →  Open SQL →  Open SQL - Operands and Expressions → 

Open SQL - SQL Expressions sql_exp

Syntax

... sql_elem
  | sql_func
  | sql_num
  | sql_cast
  | sql_string
  | sql_case ...


Effect

SQL expressions are expressions that can be specified in the following positions of Open SQL statements.

SQL expressions are passed to the database system, executed there, and the result is passed to the application server if requested. The possible operands are:

The SQL expression can be used to execute

executed. Every expression can be enclosed in parentheses. The result of an expression is used in the Open-SQL statement in accordance with the operand position, with the data type in nested expressions being specified by the outermost expression.

Notes

Example

Syntax example for specifying SQL expressions in different operand positions in a SELECT statement

SELECT FROM sflight
       FIELDS CONCAT( carrid, connid ) AS key,
              MAX( seatsmax - seatsocc ) AS max_free,
              MIN( seatsmax - seatsocc ) AS min_free
        GROUP BY carrid, connid
        HAVING SUM( seatsmax - seatsocc ) > 100
        ORDER BY key
        INTO TABLE @DATA(itab).



Continue
sql_exp - sql_elem
sql_exp - sql_func
sql_exp - sql_arith
sql_exp - sql_cast
sql_exp - sql_string
sql_exp - sql_case
sql_exp - ( )
Examples of SQL Expressions