7. Embedded SQL for Pascal : Pascal Variables and Data Types : Embedded SQL/Pascal Declarations : Program Syntax
 
Share this page                  
Program Syntax
The syntax for an Embedded SQL/Pascal program definition is:
program program_name [(identifier {, identifier})];
[exec sql begin declare section;
declarations
exec sql end declare section;]
[procedures, functions, etc.]
begin
              [statements]
end.
or:
program program_name [(identifier {, identifier})];
exec sql label
[label_declarations];
[exec sql begin declare section;
              declarations
exec sql end declare section;]
[procedures, functions, etc.]
begin
              [statements]
exec sql end.
where declarations can include any of the following:
const constant_declarations
type type_declarations
var variable_declarations
See the previous sections for descriptions of the various types of declarations.
Syntax Notes:
1. The program_name and the identifiers are not processed by ESQL.
2. The declaration sections can be in any order and can be repeated.
The following example illustrates the above points:
program Test;
exec sql label;
exec sql begin declare section;
var
    curformname, curfieldname, curcolname :
        varying[12] of char;
    curtablerow : integer;
exec sql end declare section;
begin
    {Embedded SQL and Pascal statements}
exec sql end.