15.00 - SQLSTATE Values for Java External Procedures - Teradata Database

Teradata Database SQL Data Definition Language Detailed Topics

Teradata Database
Release Number
Content Type
Programming Reference
Publication ID
English (United States)

SQLSTATE Values for Java External Procedures

A Java external procedure can raise a java.lang.SQLException code with an exception number and message that are returned to the database and used to set the SQLSTATE and error message. Java exceptions thrown during the execution of a Java external procedure using SQL are often handled within Java. When this occurs, the exceptions do not affect SQL processing. Only those Java exceptions that are not handled within Java are seen in the SQL environment as SQL exception conditions.

When this occurs, the procedure returns an exception number and message to the Teradata Database which the system then uses to set the SQLSTATE value and error message that it returns to the requestor.

The range for valid SQLSTATE SQLException codes is 38U00 - 38U99, inclusive.

Some predefined error cases, such as non‑valid JAR name, that have specific codes defined by the ANSI SQL standard, are also supported. The Teradata implementation of Java external procedures follows those definitions. See SQL External Routine Programming and SQL Stored Procedures and Embedded SQL for details.