SQL/MX 2.x Reference Manual (H06.04+)

Embedded-Only SQL/MX Statements
HP NonStop SQL/MX Reference Manual540440-003
3-37
EXEC SQL Directive
EXEC SQL Directive
EXEC SQL is a preprocessor directive that begins an embedded SQL declaration or
statement.
Use EXEC SQL only in embedded SQL programs in C or COBOL.
sql-declaration
is any embedded SQL declaration.
sql-statement
is any embedded SQL statement.
sql-terminator
terminates the SQL declaration or statement. For a C program, semicolon (;) is the
terminator. For a COBOL program, END-EXEC is the terminator.
Considerations for EXEC SQL
Using Host Language Comments
You can use host language comments within SQL statements:
C comments have the form: /* ... */. The comment is not restricted to one
line.
COBOL comments have the form: * ... The asterisk (*) is in the first column of
the source code line in free format and in the seventh column of the source code
line for fixed format. The comment is restricted to one line.
Examples of EXEC SQL
For examples of the EXEC SQL directive, see the various C and COBOL examples
throughout this section.
EXEC SQL {sql-declaration | sql-statement} sql-terminator
C/COBOL