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.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-23
dita:mapPath
xqq1557098602407.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1148
lifecycle
previous
Product Category
Teradata Vantage™

Purpose

Defines the SQL Communications Area (SQLCA) in a client embedded SQL application program.

Invocation

Nonexecutable preprocessor declaration.

Embedded SQL only.

Syntax

INCLUDE SQLCA

ANSI Compliance

INCLUDE SQLCA is a Teradata extension to the ANSI/ISO SQL:2011 standard.

Authorization

None.

Rules for Using INCLUDE SQLCA

  • 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 Topics

For more information about: