Defines the SQL Communications Area (SQLCA) in a client embedded SQL application program.
ANSI Compliance
INCLUDE SQLCA is a Teradata extension to the ANSI/ISO SQL:2011 standard.
Required Privileges
None.
Invocation
Nonexecutable preprocessor declaration.
Embedded SQL only.
Syntax
INCLUDE SQLCA
Usage Notes
- When operating in Teradata session mode, you must declare exactly one SQL Communications Area in your embedded SQL application program.
You can use either an INCLUDE SQLCA statement or an equivalent user-supplied declaration.
- When operating in ANSI session mode, Preprocessor2 flags INCLUDE SQLCA statements as an error.
ANSI/ISO SQL requires you to explicitly define a result code variable named SQLSTATE.
If you are operating in ANSI mode, you can also define an SQLCODE result code variable to receive error codes.
ANSI/ISO SQL no longer supports SQLCODE.
- The complete INCLUDE SQLCA statement, including the EXEC SQL prefix and the appropriate terminator, must be coded on one line.
Only a pad character can separate the words of the statement.
No other statements can appear on the line.
- Preprocessor2 replaces the INCLUDE SQLCA statement with the appropriate language definition of the SQL Communications Area.
- For applications written in COBOL, the SQL Communications Area declaration must appear in the WORKING STORAGE SECTION.
Related Information
- SQL result codes, see Result Code Variables, SQL Communications Area (SQLCA) and SQLSTATE Mappings.
- SQLSTATE, see SQLSTATE.
- SQLCODE, see SQLCODE.