Skip to content

ABAP Keyword Documentation →  ABAP − Reference →  Processing External Data →  ABAP Database Access →  Native SQL →  EXEC SQL - Embedded Native SQL →  EXEC SQL 

EXEC SQL - Literals

Other versions: 7.31 | 7.40 | 7.54

Syntax


... { [+|-]n[n[n[...]]] 
    | 'c[c[c[...]]]' | <i class="bn">[</i>c<i class="bn">[</i>c<i class="bn">[</i>c<i class="bn">[</i>...<i class="bn">]</i><i class="bn">]</i><i class="bn">]</i><i class="bn">]</i> } ...

Effect

Appropriate literals can be specified in ABAP syntax in suitable reading positions in embedded Native SQL statements.

The literal operator cannot be used in static Native SQL.


Example

Reads a row from the database table SPFLI using static Native SQL. The required row is specified using literals. The target range of the INTO clause is specified as a host variable. If a row was found, sy-subrc is set to 0; if not, it is set to 4.

DATA: BEGIN OF wa, 
        cityfrom TYPE spfli-cityfrom, 
        cityto   TYPE spfli-cityto, 
      END OF wa. 

EXEC SQL. 
  SELECT cityfrom, cityto 
         INTO :wa 
         FROM spfli 
         WHERE mandt  = '100' AND 
               carrid = 'LH'  AND connid = '0400' 
ENDEXEC.