
Inline adoc files when they are included exactly once. Also fix language tags because this inlining gives us better information on what language the code is written in.
54 lines
1.5 KiB
Plaintext
54 lines
1.5 KiB
Plaintext
== Why is this an issue?
|
|
|
|
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)
|
|
|
|
=== Message
|
|
|
|
If there is no other option than using native SQL, at least the ADBC API should be used.
|
|
|
|
|
|
endif::env-github,rspecator-view[]
|