Specifying nested table expressions for error tolerance

You specify the errors to tolerate in a nested table expression with the RETURN DATA UNTIL clause.

About this task

When you use the RETURN DATA UNTIL clause, you must specify the error codes that you want to tolerate. The following table lists the errors that are allowed in the specific-condition-value clause. You must specify an SQLSTATE, or an SQLSTATE and SQLCODE, that matches a permissible error code. The SQLCODEs listed in the table are required.
Table 1. Errors allowed in the specific-condition-value clause
SQLSTATE Error code SQLCODE
08001 SQL30080N -30080
08001 SQL30081N -30081
08001 SQL30082N -30082
08001 SQL1336N -1336
08004 Any Any
28000 Any Any
42501 Any Any
42512 Any Any
42704 SQL0204N -204
42720 Any Any

Procedure

To specify nested table expressions for error tolerance, create an SQL statement that contains the RETURN DATA UNTIL clause.
RETURN DATA UNTIL specific-condition-value
RETURN DATA UNTIL
Any rows that are returned from the fullselect, before the specified condition is encountered, are returned in the result set from the fullselect.
specific-condition-value
Specifies the condition and values for error tolerance.
FEDERATED
Required keyword. The specific condition that you specify must only include errors that occur at a federated data source.
SQLSTATE VALUE string-constant
You can specify a specific condition as an SQLSTATE value. The length of the string constant must be 5 when VALUE is specified. An SQLSTATE value can be narrowed down to a particular SQLCODE value. You can specify multiple SQLCODE values that share the same SQLSTATE in one specific-condition-value.