Ansicht
Dokumentation

ABENWHERE_LOGEXP_SUBQUERY - WHERE LOGEXP SUBQUERY

ABENWHERE_LOGEXP_SUBQUERY - WHERE LOGEXP SUBQUERY

Addresses (Business Address Services)   SUBST_MERGE_LIST - merge external lists to one complete list with #if... logic for R3up  
This documentation is copyright by SAP AG.
SAP E-Book

- subquery_clauses

Short Reference



Effect

Possible clauses and additions of a subquery in a condition sql_cond in .

In the FROM clause, the addition USING cannot specified to affect client handling. Client handling of the subquery depends on the client handling of the outer statement. An addition USING of the outer statement also affects the subquery.

A subquery can be used within the following relational expressions sql_cond for a subquery:

Conditions of a subquery can themselves contain subqueries. In nested subqueries, the columns specified in the SQL conditions are searched inside out and the columns of inner subqueries hide columns with the same name in outer subqueries.

Only a limited number of SELECT statements can be used as subqueries in an statement. The maximum number is defined so that the statement can be executed on all supported database systems. If known statically, more than 50 SELECT statements currently produce a syntax error and otherwise a runtime error. This restriction is independent of whether the subqueries are nested or occur in different relational expressions of the SQL condition.

The addition UP TO n ROWS can only be used after ORDER BY and the addition OFFSET can only be used after UP TO n ROWS. An ORDER BY clause in a subquery is not supported by all databases. This results in a syntax check warning from the extended program check that can be hidden using the pragma ##db_feature_mode[limit_in_subselect_or_cte]. If this is detected at runtime on a database that does not support the pragma, a catchable exception of the class CX_SY_SQL_UNSUPPORTED_FEATURE is raised.

Notes

  • In a correlated subquery, a DDIC projection view cannot be accessed in the surrounding SELECT statement.
  • In subqueries that are used in the WHERE condition of a DELETE or UPDATE statement, the DDIC database table to be changed cannot be accessed.
  • If a CDS view is defined as a replacement object for a database table or DDIC database view specified as a data source of the SELECT statement of the subquery, the subquery accesses the CDS view and not the DDIC database table or the DDIC database view.
  • In an ABAP program, it is possible to use the method USE_FEATURES of the class CL_ABAP_DBFEATURES to check whether the current database system or a database system accessed using a secondary connection supports ORDER BY clauses in subqueries. This requires the constant LIMIT_IN_SUBSELECT_OR_CTE of this class to be passed to the method in an internal table.

Subquery in WHERE Condition






CPI1466 during Backup   rdisp/max_wprun_time - Maximum work process run time  
This documentation is copyright by SAP AG.

Length: 5975 Date: 20240420 Time: 150557     sap01-206 ( 103 ms )