All embedded SQL statements in COBOL programs are preceded by the keywords EXEC SQL and followed by the keyword END-EXEC as shown in the following format.
EXEC SQL
statement
END-EXEC
The alternate format is shown in the following.
EXEC SQL statement END-EXEC
EXEC SQL and END-EXEC are reserved words for use by the CA Datacom/DB Preprocessor. When the Preprocessor scans the host source, it uses the EXEC SQL and END-EXEC to identify SQL statements to be passed to CA Datacom/DB for preparation.
These keywords must be finished on the same line as they were started. They cannot be continued to another line.
The first character of the EXEC SQL keyword must be the first significant character on that line. The recommended position is column 12 or further right. Do not terminate the EXEC SQL keyword with a period (.). Terminating the EXEC SQL keyword with a period results in a syntax error.
The END-EXEC keyword must be the only or last word on the line. Terminating the END-EXEC keyword with a period (.) is only necessary when a period is required to make the embedded SQL statement consistent with the COBOL logic of your program. The generated COBOL code has a period at the end of the statement only if you terminated the END-EXEC with a period. For all other embedded SQL statements (declarative or Preprocessor declarations and instructions) a terminating period after END-EXEC is not necessary and is ignored.
Note: See Executable SQL Statements for information about submitting SQL statements online using the Interactive SQL Service Facility.
|
Copyright © 2014 CA.
All rights reserved.
|
|