Sign in

docs RPG Reference

Db2 for i Syntax

Db2 for i Syntax

Syntax for Entering Free-Form SQL Statements into an ILE RPG Program

Free-form SQL statements begin with EXEC SQL and end with a semicolon.

a = 1;
b = 2;
EXEC SQL SET :c
                = 3;
d = 4;

Syntax for Entering Fixed-Form SQL Statements into an ILE RPG Program

Fixed-form SQL statements begin with the EXEC SQL directive and end with the END-EXEC directive.

C                   EVAL      a = 1
C                   EVAL      b = 2
C/EXEC SQL
C+ SET :c
C+       = 3
C/END-EXEC
C                   EVAL      d = 4