7. Embedded SQL for Pascal : The SQL Communications Area : The Include SQLCA Statement
 
Share this page                  
The Include SQLCA Statement
You should issue the include sqlca statement in the outermost scope of your Pascal program:
program Emp_Update( input, output )

exec sql include sqlca;

{Declarations, procedures, etc.}
begin
            {Host language and embedded statements}

end.
The include sqlca statement generates a Pascal include directive to make certain calls generated by the preprocessor acceptable to the compiler. The include sqlca statement also generates a Pascal include directive to define the SQLCA (SQL Communications Area) record, used for error handling and defining the indicator type used for null indicators.
Whether or not you intend to use the SQLCA for error handling, you must issue an include sqlca statement. If you do not issue it, the Pascal compiler will generate errors about undeclared built-in function and procedure names. Note that some error handling mechanism should be included before all executable Embedded SQL database statements, as the default action is to ignore errors, which is rarely desirable.