15.10 - Teradata Mode Communications Area - Preprocessor2 for Embedded SQL

Teradata Preprocessor2 for Embedded SQL Programmer Guide

Preprocessor2 for Embedded SQL
Programming Reference

Each application must include one SQLCA within the scope of all executable SQL statements.

SQLCA is documented in the SQL Stored Procedures and Embedded SQL (B035‑1148).

Define the SQLCA structure in one of two ways:

  • Code an EXEC SQL INCLUDE SQLCA statement, which causes PP2 to generate the structure.
  • Code the SQLCA directly into the program. The structure must be named SQLCA and must be unique.
  • Generate an SQLCA structure for a PL/I application as follows:

    DCL 1 SQLCA,
          2  SQLCAID  CHAR(8)        INIT(’SQLCA’),
          2  SQLCABC     FIXED BIN(31)     INIT(136),
          2  SQLCODE     FIXED BIN(31),
          2  SQLERRM   CHAR(70) VAR,
          2  SQLERRP   CHAR(8),
          2  SQLERRD(6)FIXED BINARY(31),
          2  SQLWARN,
             3 SQLWARN0  CHAR(1),
             3 SQLWARN1  CHAR(1),
             3 SQLWARN2  CHAR(1),
             3 SQLWARN3  CHAR(1),
             3 SQLWARN4  CHAR(1),
             3 SQLWARN5  CHAR(1),
             3 SQLWARN6  CHAR(1),
             3 SQLWARN7  CHAR(1),
             3 SQLWARN8  CHAR(1),
             3 SQLWARN9  CHAR(1),
             3 SQLWARNA  CHAR(1),
          2  SQLEXT         CHAR(5);