SAP ABAP SQL DB HINTS



Get Example source ABAP code based on a different SAP table
  


• /pt_HINTS SELECT
• /pt_HINTS DELETE
• /pt_HINTS UPDATE
• ADABAS /pt_HINTS
• AS400 /pt_HINTS
• DB2 /pt_HINTS
• DB6 /pt_HINTS
• HDB /pt_HINTS
• MSSQLNT /pt_HINTS
• ORACLE /pt_HINTS
• SYBASE /pt_HINTS

AB_SQL - Database Hints

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

What does it do?
The addition %_HINTS can be used to specify database hints at the following positions in AB-SQL statements:
After the clauses of SELECT statements in main and subqueries.
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: AdditionDatabase System
ADABASSAP MaxDB
AS400IBM System i (AS/400)
DB2IBM DB2
DB6IBM DB2 UDB
HDBSAP HANA database
MSSQLNTMicrosoft SQL Server
ORACLEOracle DB
SYBASESybase 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.



Latest notes:

A database hint usually only affects the part of an AB-SQL 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 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.
BEGIN_SECTION SAP_INTERNAL_HINT
For more information, see note 129385.
END_SECTION SAP_INTERNAL_HINT
NON_V5_HINTS
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 ABAP_STRICT_765 strict mode as of ABAP_RELEASE ABAP_765 / only, statically known database hints are also checked statically.
In the strict modes of the syntax check from ABAP_RELEASE ABAP_740_SP05 , the escape character @ must be specified in front of a hint that is not specified as a literal.
ABAP_HINT_END

ABAP_EXAMPLE_VX5
Specification of a HANA-specific database hint for the SAP HANA database.
ABEXA 01207
ABAP_EXAMPLE_END