15.10 - StatementStatus - Call-Level Interface Version 2

Teradata Call-Level Interface Version 2 Reference for Mainframe-Attached Systems

prodname
Call-Level Interface Version 2
vrm_release
15.10
category
Programming Reference
featnum
B035-2417-035K

Purpose

For a session that permits its use, StatementStatus may be returned upon completion of a Teradata SQL statement instead of Success, OK, Error, Failure, ErrorInformation, and StatementError parcels. Even when permitted, StatementStatus may or may not be used.

Usage Notes

This parcel is generated by the Teradata Database.

Parcel Data

The following information applies to the StatementStatus parcel.

 

Table 79: StatementStatus Parcel Information 

Flavor

Mnemonic

TRDSPBTU

Field

Length

Value

205

TRDSPFTU

PBTUST

1 byte unsigned integer

The status of the statement, as one of the following:

  • 0 if Success or OK
  • 1 if Error
  • 2 if Failure
  • 3 if Statement‑Error
  •  

     

    PBTURM

    1 byte unsigned integer

    When the status is Success or OK, the Response Mode, if applicable, specified for the request, as one of the following:

  • 0 if not applicable
  • 1 if Field mode
  • 2 if Record mode
  • 3 if Indicator mode
  • 4 if Multipart-indicator mode
  •  

     

     

     

    2 byte unsigned integer

    Bytes that are currently unused.

     

     

    PBTUSNUM

    4 byte unsigned integer

    The number of the Teradata SQL statement in the request.

     

     

    PBTUCODE

    2 byte unsigned integer

    When the status is Error, Failure, or Statement‑Error, the Database error code, described in the Teradata Messages manual, where the error code is the message number.

     

     

    PBTUATYP

    2 byte unsigned integer

    When the status is Success or OK, the encoded representation of the Teradata SQL statement. See Table 66 on page 430 for more information.

     

     

    PBTUACNT

    8 byte unsigned integer

    When the status is Success or OK, the total number of records selected, inserted, updated, or deleted by the statement.

     

     

    PBTUFCNT

    8 byte unsigned integer

    When the status is Success or OK, the total number of fields returned in each record.

     

     

     

    4 byte unsigned integer

    Bytes that are currently unused.

    The rest of the parcel, if any, consists of one or more self-defining expressions that supply any context-dependent information. Each extension begins with the following header:

     

    TRDSAUXI

    Field

    Length

    Description

    PBTUXIID

    2 byte unsigned integer

    Information identifier, as one of the following:

  • 1 if warning message
  • 10 if Merge activity counts
  • 27 if TDP generated the response
  • PBTUXILN

    4 byte unsigned integer

    Number of bytes of data, not including this header.

    Following the standard header is data that depends upon the information id.

    The Warning Message extension consists of the following information:

     

    TRDSAUWM

    Field

    Length

    Description

    PBTUWMIH

    6 bytes

    The extension header described in above as the TRDSAUXI area.

    PBTUWMCD

    2 byte unsigned integer

    The Database warning code, described in the Messages manual, where the warning code is the message number.

    PBTUWMCO

    2 byte unsigned integer

    The Database origin of the warning code. Currently unused. If it is used in the future, it will be described in the Teradata Messages manual.

    PBTUWMTL

    4 byte unsigned integer

    The length, in bytes, of the message.

    PBTUWMTX

    Characters in the character set when the request was initiated, for the number of bytes defined by the PBTUWMTX field. For character sets allowing multiple bytes per character, the number of characters may be less than the number of bytes.

    The text of the message.

    The Merge Activity Counts extension consists of the following information:

     

    TRDSAUMC

    Field

    Length

    Description

    PBTUMCIH

    6 bytes

    The extension header described above as the TRDSAUXI area.

    PBTUMCI

    8 byte unsigned integer

    The total number of records inserted by the statement.

    PBTUMCU

    8 byte unsigned integer

    The total number of records updated by the statement.

     

    8 byte unsigned integer

    Bytes that are currently unused.

    The TDP‑Generated Response extension consists of the following information:

     

    TRDSAUTG

    Field

    Length

    Description

    PBTUTGIH

    6 bytes

    The extension header described above as the TRDSAUXI area.

    PBTUTGR

    1 byte unsigned integer

    One of the following:

  • 1 if the request was satisfied from a pool
  • 2 if the Database response had been lost
  • PBTUGE

    8 bits

    Any exceptions that occurred when building the response, each indicated by a specific bit, more than one of which can be present, as follows:

  • hexadecimal 80 if including the user name would have exceeded the response buffer