ABAP Keyword Documentation → ABAP − Reference → Processing External Data → ABAP Database Access → ABAP SQL → ABAP SQL - Overview → ABAP SQL - Table Buffering
Table Buffering - SQL Expressions
SQL expressions are usually evaluated on the database and and any built-in functions used as operands of these expressions are usually executed on the database too. If used, SQL expressions then bypass table buffering. The following expressions and functions, however, have an implementation in the table buffer and table buffering is not bypassed when they are used in reads (including nested reads).
- Numeric functions
- String functions
- Null value function
COALESCE (in the
- Case distinctions (in the
The expressions and functions can be used in both
lists and in
If a catchable exception is raised when an SQL expression is evaluated in the table buffer, it is wrapped by the class CX_SY_OPEN_SQL_DB and can be handled using this class. The attribute PREVIOUS of the associated exception object is then given the name of the original exception class.
7.31 | 7.40 | 7.54
- When an SQL expression is evaluated in the table buffer, the same results are produced as on the database and not as in the corresponding ABAP evaluation. The following are some examples:
- Evaluations of the functions
MODthat are not the same as calculations with the identically named ABAP operators.
- Operands of the type SSTRING that do not have trailing blanks on the database, unlike in ABAP.
- Any null values produced
as results of nested expressions (for example in the
COALESCEfunction or in comparisons) are handled as null values.
- The result of a relational expression with columns that contain
values is unknown, except in the case of the expression
IS [NOT] NULL.
- If an SQL expression can be evaluated in the table buffer, any internal tables used as data sources of a query can also be evaluated on AS ABAP rather than their content having to be transported to the database. .