49 lines
1.4 KiB
Plaintext
49 lines
1.4 KiB
Plaintext
The ``++EXEC SQL ... END-EXEC++`` statement can be used to embed Native SQL statically in ABAP programs.
|
|
|
|
|
|
According to the SAP documentation:
|
|
|
|
____
|
|
Alongside ADBC, it is also possible to embed Native SQL statically between ``++EXEC SQL++`` and ``++ENDEXEC++`` in ABAP programs. The recommendation, however, is to use ADBC. While the static embedding of Native SQL offers exclusively static access to the Native SQL interface, ADBC makes modern object-orientated and dynamic access possible. New developments and improvements, such as optimized performance using bulk access across internal tables, are now made only for ADBC.
|
|
|
|
|
|
The existing static embedding of Native SQL statements is still supported but should no longer be used in new programs.
|
|
|
|
____
|
|
|
|
|
|
== Noncompliant Code Example
|
|
|
|
[source,abap]
|
|
----
|
|
EXEC SQL.
|
|
CREATE TABLE abap_docu_demo_mytab (
|
|
val1 char(10) NOT NULL,
|
|
val2 char(10) NOT NULL,
|
|
PRIMARY KEY (val1) )
|
|
ENDEXEC.
|
|
----
|
|
|
|
|
|
== Compliant Solution
|
|
|
|
[source,abap]
|
|
----
|
|
NEW cl_sql_statement( )->execute_ddl(
|
|
`CREATE TABLE ` && dbname &&
|
|
`( val1 char(10) NOT NULL,` &&
|
|
` val2 char(10) NOT NULL,` &&
|
|
` PRIMARY KEY (val1) )` ).
|
|
----
|
|
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
|
|
'''
|
|
== Implementation Specification
|
|
(visible only on this page)
|
|
|
|
include::message.adoc[]
|
|
|
|
endif::env-github,rspecator-view[]
|