Labels
Like C statements, embedded SQL statements can have a label prefix. The label must begin with an alphabetic character or an underscore. The label must be the first word on the line (optionally preceded by white space), and must be terminated with a colon (:).
Example: Valid label prefix usage
close_cursor: exec sql close cursor1;
The label can appear anywhere a C label can appear. However, although the preprocessor accepts a label before any exec sql or exec frs prefix, you cannot label some lines. Although the preprocessor accepts the following label prefix example, the compiler does not because labels are not allowed before declarations:
Example: Invalid label prefix usage
include_sqlca: exec sql include sqlca;
As a general rule, use labels only with executable statements.
Last modified date: 11/09/2022