Stored Procedure Return Result - Call-Level Interface Version 2

Teradata® Call-Level Interface Version 2 Reference for Workstation-Attached Systems - 20.00

Call-Level Interface Version 2
Release Number
January 2024
English (United States)
Last Update
Product Category
Teradata Tools and Utilities

Usage Notes

The application sends the statements composing a procedure to the database, where they are compiled and saved for subsequent execution. The application that defines the procedure must send an SQL statement to create (CREATE PROCEDURE) or replace (REPLACE PROCEDURE) the procedure.

If the database does not support External Stored Procedures the SQL will be rejected (there is no capability provided to ensure that the SQL is supported).

If it is supported, an ElicitFile response parcel will be returned, whereupon the application uses the CLIv2 ContinueRequest function to send the procedure's statements to the database.

When all statements have been sent, the procedure is compiled and saved on the database. The character set used for compilation is the character set used when the procedure is created or replaced.

Using the Procedure

To invoke a previously compiled and saved procedure, an SQL CALL statement is sent to the database. When called, the procedure that was defined with the SQL READS SQL DATA or WRITES SQL DATA clause may itself invoke CLIv2 to establish a connection and send SQL requests. Such a connection may either be a new connection (a DBCAREA Use-default-conn value of 'N'), for which a standard database logon string would be supplied, or the connection could use the same session used to CALL the procedure (a DBCAREA Use-default-conn value of 'Y').

The latter is known as the default connection, and has some limitations. Specifically, the character set used when the procedure is executed is the character set established when the procedure is created or replaced, not the character set being used when the CALL is sent. No capability is provided for the procedure to ascertain this character set.

Also, the following options established by the application cannot be changed:
  • Date-form
  • Language-conformance
  • Statement-status
  • Transaction-semantics
  • 2PC

No capability is provided for the procedure to ascertain the application's setting for these options. Also, the default connection may not be disconnected.

The procedure may use the DBCAREA Return-result-to option to provide CLIv2 the same information that would be provided by the WITH RETURN clause on the SQL PROCEDURE statement for an SQL Stored Procedure. Specifically, whether the results for an SQL request are returned to the requester, the caller of the procedure, or the application. If propagated to the caller or application, the parcels are preceded by a ResultSet response parcel.

Language Variable Name
C: SP_return_result
Routine Action Taken
DBCHINI: writes
Used by Action Taken
application program writes

Possible value can be set in this DBCAREA field is 0 through 5.