SQL Programming Manual for Pascal
NonStop SQL Statements and Directives
HP NonStop SQL Programming Manual for Pascal—528614-001
3-2
Placing Statements and Directives in a Program
•
A SQL statement or directive can span several lines in the source text. For 
example:
EXEC SQL
 SELECT CUSTOMER.CUSTNAME
 INTO : CUSTOMER.CUSTNAME
 FROM SALES.CUSTOMER
 WHERE CUSTNUM = :FIND_THIS_CUSTOMER;
•
Use either SQL or Pascal comments in statements and directives.
An SQL comment statement begins with a double hyphen (--) and ends with the 
end of the line.
A Pascal comment begins with a brace ( { ) and ends with a brace ( } ).
•
To delimit string literals in SQL statements, you can use either a single quotation 
mark (') or double quotation marks (''), but you must use the same character at 
both ends of the string.
•
You cannot use an SQL statement in a compound Pascal statement.
•
You cannot use a DEFINE declaration within an SQL statement.
•
You cannot nest SQL statements or directives.
Placing Statements and Directives in a Program
Place SQL statements and directives in a Pascal source file as described next.
SQL Directives and Statements
The SQL directive enables the Pascal compiler to process subsequent SQL 
statements and directives. You must specify the SQL directive before the first SQL 
statement or Pascal source code statement (except comments).
Specify the SQL directive either in your source code file or as a compiler option in the 
implicit TACL RUN command for the Pascal compiler. An example of the SQL directive 
in a source code file is:
?SQL
An example of the SQL directive as a compiler option is:
Pascal /IN TSRC, OUT $S.#TLST, NOWAIT/ TOBJ; SQL










