INCLUDE SQLCA | Teradata Vantage - INCLUDE SQLCA - Advanced SQL Engine - Teradata Database

SQL Stored Procedures and Embedded SQL

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2021-07-28
dita:mapPath
vqj1592443206677.ditamap
dita:ditavalPath
vqj1592443206677.ditaval
dita:id
B035-1148
lifecycle
previous
Product Category
Teradata Vantageā„¢

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