Delimiting SQL in a Program

In order to distinguish SQL calls from the rest of the program, delimiters are used. Although used in languages, the actual delimiters and methods differ considerably by language. For all languages using the standard precompiler, however, the methods are very similar. For example, use EXEC SQL and END-EXEC to delimit a SQL statement in a COBOL program:

EXEC SQL 
a SQL statement
END-EXEC.

NOTE

For REXX, precede the statement with EXECSQL. If the statement is in a literal string, enclose it in single or double quotation marks.

Get DB2® Universal Database™ for OS/390™ v7.1 Application Certification Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.