WAIT Usage Notes - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
ft:locale
en-US
ft:lastEdition
2024-12-11
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

Each async_statement_identifier must be unique (up to 30 bytes) across all active connections and is case-sensitive.

If there is no outstanding asynchronous SQL statement, then the exception condition "no outstanding asynchronous SQL statement" is raised.
  • SQLCODE is set to -650.
  • SQLSTATE is set to '04000'.
Option When WAIT Statement Returns
ALL When all asynchronous statements have finished.
ANY COMPLETION INTO When any of the outstanding asynchronous statements finishes.

The asynchronous statement identifier is returned to the host variable async_statement_variable in the INTO clause, and the session identifier is returned to the host variable session_variable.

The host variables async_statement_variable and session_variable must be defined as a fixed or varying length character variable with a maximum length of 30 bytes.

If the asynchronous statement identifier returned is longer than the length defined for the output host variable, then the exception condition "output host variable is too small to hold returned data" is raised.
  • SQLCODE is set to -304.
  • SQLSTATE is set to '22003'.
WAIT is not valid within the following request types:
  • Cursor requests specified by the DECLARE CURSOR statement.
  • Dynamic requests specified by the PREPARE or EXECUTE IMMEDIATE statements.