Defines the SQL Communications Area (SQLCA) in an Embedded SQL program.
exec sql include sqlca end-exec
EXEC SQL INCLUDE SQLCA END-EXEC.
...
EXEC SQL UPDATE test SET col1 = col1 + 100 END-EXEC.
IF SQLCODE = 0
DISPLAY "UPDATED ",SQLERRD(3), " ROWS."
ELSE
IF SQLCODE = 100
DISPLAY "NO ROWS WERE AFFECTED."
ELSE
DISPLAY "AN ERROR OCCURED - ",SQLERRMC.
END-IF
END-IF.
EXEC SQL COMMIT WORK END-EXEC.
The include sqlca statement can be used anywhere that host language declarations are allowed.
begin declare section