diagnostic_statement - Advanced SQL Engine - Teradata Database

SQL Data Definition Language Syntax and Examples

Product
Advanced SQL Engine
Teradata Database
Release Number
17.00
Published
September 2020
Language
English (United States)
Last Update
2021-01-23
dita:mapPath
wgr1555383704548.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1144
lifecycle
previous
Product Category
Teradata Vantage™

diagnostic statement

A SIGNAL, RESIGNAL, or GET DIAGNOSTICS statement. For details, see Teradata Vantage™ - SQL Stored Procedures and Embedded SQL , B035-1148 .

You can specify these options for diagnostic statements.

SIGNAL
Keyword introducing the SIGNAL SQL procedure diagnostic statement. See Teradata Vantage™ - SQL Stored Procedures and Embedded SQL , B035-1148 for details.
condition_name
Name of a variable declared to handle a condition within an SQL procedure.
See Teradata Vantage™ - SQL Fundamentals, B035-1141 for the rules for naming database objects.
If condition_name specifies a condition that corresponds to an SQLSTATE value, the value of that SQLSTATE is assigned to RETURNED_SQLSTATE in the Condition Area.
RESIGNAL
Keyword introducing the RESIGNAL SQL procedure diagnostic statement.See Teradata Vantage™ - SQL Stored Procedures and Embedded SQL , B035-1148 for details.
condition_name
Name of a variable declared to handle a condition within an SQL procedure.
See Teradata Vantage™ - SQL Fundamentals, B035-1141 for the rules for naming database objects.
If condition_name specifies a condition that corresponds to an SQLSTATE value, the value of that SQLSTATE is assigned to RETURNED_SQLSTATE in the Condition Area.
SQLSTATE_code
Value for an SQLSTATE to be assigned to RETURNED_SQLSTATE in the Condition Area.
condition_information
One of the field names from the Condition Area of the Diagnostics Area.
See Teradata Vantage™ - SQL Stored Procedures and Embedded SQL , B035-1148 for details.
See Teradata Vantage™ - SQL Fundamentals, B035-1141 for the rules for naming database objects.
value
Text or numeric value, as appropriate, to be assigned to the specified condition information name.
GET DIAGNOSTICS
Keywords introducing the GET DIAGNOSTICS SQL procedure diagnostic statement.See Teradata Vantage™ - SQL Stored Procedures and Embedded SQL , B035-1148 for details.
parameter_name
Parameter whose value is set to the value contained in statement_information_item.
The maximum length of a database object name is either 30 LATIN characters or 128 Unicode characters. For details about object name length limits, see Teradata Vantage™ - SQL Fundamentals, B035-1141.
variable_name
Variable whose value is set to the value contained in statement_information_item.
statement_information_item
One of the field names from the Statement Area of the Diagnostics Area. See Teradata Vantage™ - SQL Stored Procedures and Embedded SQL , B035-1148 for details.
EXCEPTION
A language element that indicates to return information from the Condition Area of the Diagnostics Area.
condition_number
Number, parameter, or variable that resolves to the number of the Condition Area from which information is to be retrieved.
parameter_name
variable_name
An output parameter or variable to which the condition_information_item retrieved from the specified Condition Area is assigned.
The maximum length of a database object name is either 30 LATIN characters or 128 Unicode characters. For details about object name length limits, see Teradata Vantage™ - SQL Fundamentals, B035-1141.
condition_information_item
Name of the Condition Area field from which condition information is to be retrieved. See Teradata Vantage™ - SQL Stored Procedures and Embedded SQL , B035-1148 for a list of the valid condition information item names.
See Teradata Vantage™ - SQL Fundamentals, B035-1141 for the rules for naming database objects.