15.10 - Creating a Request with CLIv2 - Teradata Database

Teradata Database Application Programming Reference

prodname
Teradata Database
vrm_release
15.10
category
Programming Reference
featnum
B035-1090-151K

Your client application program tells CLIv2 what to do by creating a request string consisting of:

  • A request parcel (when the response is desired in record mode) or an IndicReq parcel (when the response is desired in indicator mode).
  • When the response mode option is set in CLI or CLIv2, it automatically uses the correct request parcel format.

  • A USING Data String, which contains the input data.
  • Unlike Teradata SQL, PM/API does not use a USING Phrase to name the variables and reserve space in the request parcel. Instead, each MONITOR request has a USING Data String of a particular fixed format that determines the order of items, their data types, and lengths.

    Because a USING Data String is required, either a data parcel must follow a request parcel or an IndicData parcel must follow an IndicReq parcel.

    An IndicData parcel is recommended, because several of the fields in the USING Data String can be NULL.

    Generating an IndicReq parcel results in a response that contains a PclDataInfo parcel, which describes the number of response columns. Each Record parcel returned begins with a number of presence bits, that supply the NULL indicators for the result columns.

    To pass PM/API requests to Teradata Database as the text portion (body field) of the request parcel, the application program calls the CLIv2 DBCHCL routine with the DBCAREA function code (4) set to the Initiate Request operation.

    Code your application program to do the following before calling CLIv2 for the Initiate Request operation:

  • Set the request pointer to the address of a character string containing the request name.
  • Note: For the IDENTIFY request, set the request pointer to the address of a character string containing one of the following:

  • IDENTIFY SESSION
  • IDENTIFY DATABASE
  • IDENTIFY USER
  • IDENTIFY TABLE
  • Set the request length to the length in bytes of the character string.
  • Set the USING Data pointer to the address of the USING Data String.
  • Set the USING Data Length to the length in bytes of the USING Data String.
  • Setting Indicator or Record Mode

    You can send the USING Data String in either indicator mode or record mode. CLI must inform CLIv2 which mode is used by setting the appropriate use presence bits option in the DBCAREA.

    Note: The use presence bits option is usually set to a default value for the site.

     

    If you want...

    Do the following ...

    to change the default value

    Set change options to Y in the application program. Set the use presence bits option in the DBCAREA to Y.

    Note: This also allows the application program to send NULL data to the Teradata Database system.

    the USING Data String sent in record mode

    Set change options to Y in the application program. Set the use presence bits option to N in the DBCAREA in the application program.