Teradata Preprocessor2 (SPP Prefix) Messages
Preprocessor2 (PP2) is the Vantage precompiler and runtime SQL statement manager.
This chapter contains the codes and associated text which the precompiler may issue. In addition it describes the preprocessor diagnostic handling scheme and the return codes that an application program may receive.
Each diagnostic issued by the precompiler is associated with one of several severity levels.
Each time preprocessing completes, the preprocessor terminates with a return code determined by the level of the most severe diagnostic that was issued.
The severity levels and their associated return codes are as follows:
Diagnostics returned by the preprocessor have identifying numbers of the form SPPnnnn, where nnnn is a four-digit number.
Most diagnostics displayed on the output listing consist of at least two lines. The first line always takes one of the following forms, depending on how precisely the diagnostic can be associated with a specific location in the input source program:
SPPnnnn <severity>, statement beginning on line <linenum> SPPnnnn <severity> at line <linenum>, column <column> Diagnostic Handling The preprocessor returns error information to the application using multiple mechanisms. The primary communication method for applications not using ANSI mode is via the SQLCA structure discussed in Teradata Preprocessor2 for Embedded SQL Programmer Guide. ANSI mode applications report errors via the SQLCODE and SQLSTATE variables. The SQLCA provides the following to the application: + Result reporting + Warning condition reporting + Support for DSNTIAR The application may also retrieve the full diagnostic text by using a supplied routine, as described in the following passages. Include a test of SQLCODE after each execution of an embedded SQL statement to ensure that the statement completes successfully. Also, take appropriate action to resolve unacceptable SQLCODE values. For more information on SQLCODE checking, see the Teradata Preprocessor2 for Embedded SQL Programmer Guide. The results of all SQL requests sent from an application are reported in the SQLCODE field of the SQLCA structure. An application may obtain additional diagnostic help for a non-zero SQLCODE by invoking PPRTEXT. PPRTEXT returns the error code (normally the same value as in the first SQLERRD element) and the textual message associated with the condition. The following four parameters are required to execute PPRTEXT: + The address of the runtime context area, SQL-RDTRTCON for COBOL and SQL_RDTRTCON for C and PL/I. + A 4-byte integer field to contain the actual error code. + A varying character field up to 255 characters long to contain the error text. + A 2-byte integer field which contains the maximum size of the error text to be returned. Examples of PPRTEXT usage appear in the language-dependant chapters. Warning conditions are reported to the application via the SQLWARNx fields in the SQLCA structure. SQLWARN0 contains the value W if any warning condition is detected during execution. The warning fields are used to signal such conditions as implicit rollbacks and data truncation. See SQL Stored Procedures and Embedded SQL for details of the exact values and conditions of each warning field. Error codes for retryable events also are indicated via the SQLWARNx fields. SQLWARN6 is set to R when such an error is detected. The application may then take the appropriate action. The following table lists current retryable errors. These codes are found in the first SQLERRD element of the SQLCA structure. Whenever possible, the SQLERRM field of the SQLCA structure will contain message inserts usable by the IBM-supplied routine DSNTIAR. Details of the SQLERRM field are found in Teradata Preprocessor2 for Embedded SQL Programmer Guide. DSNTIAR operation is discussed in the vendor documentation. Mapped CLI Code to SQLSTATE For information on mapped CLI code to SQLSTATE, see SQL Stored Procedures and Embedded SQL. Mapped CLI Code to SQLCODE For information on mapped CLI code to SQLCODE, see SQL Stored Procedures and Embedded SQL.
The message code, level of severity, associated message text, possible cause, and possible solution for the precompiler diagnostics are listed below. Brackets (<>) are used to indicate information supplied by the precompiler when the diagnostic is issued.