The Structured Query Language

The DB2® UDB for iSeries® database can be accessed from an ILE RPG program by embedding SQL statements into your program source. The syntax is shown in DB2 UDB for iSeries Syntax. Use the following rules to enter SQL statements:
You must enter a separate command to process the SQL statements.
Note: SQL statements cannot be specified in the referred source member of a /COPY statement.

Refer to the IBM® i Information Center database and file systems category for the descriptions of how to code SQL statements.