Skip to content

ABAP Keyword Documentation →  ABAP - Reference →  Processing External Data →  ABAP Database Accesses →  Native SQL 

EXEC SQL - Embedded Native SQL

The following ABAP statements are used to embed Native SQL statically in ABAP programs:

EXEC SQL
  ...
ENDEXEC

Native SQL statements embedded between EXEC SQL and ENDEXEC do not fall within the scope of ABAP and do not follow ABAP syntax. Mainly, database-specific SQL statements can be embedded that are passed unchanged from the Native SQL interface to a database system, and executed there. The full SQL language scope of the relevant database can be used and the addressed database tables do not have to be declared in ABAP Dictionary. In addition, a small set of SAP-specific Native SQL statement are available that can only be specified between EXEC SQL and ENDEXEC and that are subject to special handling by the Native SQL interface.

Other versions: 7.31 | 7.40 | 7.54

Programming Guideline

Using Open SQL


Note

If Native SQL is used instead of Open SQL, the use of ADBC is recommended.

Continue

EXEC SQL

Static Native SQL - Example