Ansicht
Dokumentation

ABENABAP_SQL_DB_HINTS - ABAP SQL DB HINTS

ABENABAP_SQL_DB_HINTS - ABAP SQL DB HINTS

PERFORM Short Reference   Fill RESBD Structure from EBP Component Structure  
This documentation is copyright by SAP AG.
SAP E-Book

- Database Hints

... %_HINTS db @dbhint1
           $[db @dbhint2
            ... $]  ...


Effect

The addition %_HINTS can be used to specify database hints at the following positions in statements:

  • After the WHERE condition of the statements UPDATE and DELETE.

One or more database hints can be specified after %_HINTS as a blank-separated list in flat, character-like literals or host variables dbhint1, dbhint2, .... The addition db must be used in front of each database hint to specify the database system for which the hint is intended. The following table shows the possible additions and the associated database system:

Addition Database System
ADABAS SAP MaxDB
AS400 IBM System i (AS/400)
DB2 IBM DB2
DB6 IBM DB2 UDB
HDB SAP HANA database
MSSQLNT Microsoft SQL Server
ORACLE Oracle DB
SYBASE Sybase ASE

A database system can be specified more than once if there are multiple database hints for this system. The possible database hints are database-specific and may depend on the release of the database system. They can be found in the documentation of the respective database system. An empty hint is ignored.

Any database hints specified are ignored if table buffering is used.

Notes

  • A database hint usually only affects the part of an statement for which is it specified. It does not usually affect the way a statement works, but may affect performance.
  • Database hints should only be used with extreme caution. For example, they can be used as a last resort to affect the optimizer of the database system when selecting a secondary index.
  • If database hints are used, they should generally be checked every time the database release or system configuration is changed.
  • Database hints specified as literals are also not evaluated until runtime. If the syntax is incorrect, they can cause exceptions at runtime or are ignored. In the strict mode as of Release only, statically known database hints are also checked statically.
  • Database hints of the database interface are intended for internal use only. These are noted between & characters and are evaluated by the database interface before they are transferred to the database system.
  • In the strict modes of the syntax check from Release , the escape character @ must be specified in front of a hint that is not specified as a literal.

Example

Specification of a HANA-specific database hint for the SAP HANA database.






PERFORM Short Reference   Fill RESBD Structure from EBP Component Structure  
This documentation is copyright by SAP AG.

Length: 5335 Date: 20240328 Time: 205239     sap01-206 ( 94 ms )