16.20 - tdr.SetError - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL External Routine Programming

Product
Advanced SQL Engine
Teradata Database
Release Number
16.20
Release Date
April 2020
Content Type
Programming Reference
Publication ID
B035-1147-162K
Language
English (United States)

Purpose

Sets an error code and message to be displayed on the console when the query invoking the table operator is executed and an error is encountered.

Syntax

tdr.SetError(code,  message)
code
Parameter type: character

An error code.

message
Parameter type: character

An error message.

Example: Displaying an Error Code and Message

Suppose the data in the input table has invalid values. You can report the error using the following statement which prints out the error code "U1003" with message "Invalid Value for Division Number".

tdr.SetError("U1003", "Invalid Value for Division Number")