Multi-Statement Management - Teradata Tools and Utilities

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

Teradata Tools and Utilities
Release Number
June 2021
English (United States)
Last Update
Product Category
Teradata Tools and Utilities

Two or more Teradata SQL statements, separated by semicolons, can be combined into a single request. The database attempts to execute these statements in parallel. A single response is returned, consisting of the results for each statement, which the application processes until all are exhausted.

If the DBCAREA Multi-statement-errors option is 'N' and a statement fails, an Error or Failure parcel is present and the other statements are not processed. If the DBCAREA Multi-statement-errors option is 'Y' and a statement fails with certain types of data errors, a StatementError parcel is returned for that statement, and the other statements are processed. If a statement succeeds, the first parcel is a Success, OK, or StatementStatus parcel; various parcels follow, ending with an EndStatement parcel. The last parcel is an EndRequest parcel.

The first parcel always contains the statement number, which normally corresponds to the ordinal position of the statement in the request; however, if a statement is an SQL CALL, and the DBCAREA Result-sets-OK options allows the called procedure to return response parcels, each such returned response will also increment the statement number, the ActivityType will be 176. The presence of the ResultSet parcel indicates such additional statement numbers.