Icon RETRY

Retries an insert, update, or delete operation.

Syntax
RETRY

Usage
Use this statement to retry an insert, update, or delete operation from within the body of an error trigger. Error triggers are called whenever there is an error in an insert, update, or delete operation. If the trigger body has taken action to rectify the original exception that caused the error trigger to be called, then the RETRY statement can retry the operation. The body of the trigger is exited immediately at the point where the RETRY statement is specified, and any code after that point is skipped. Please see the CREATE TRIGGER statement for more information.

Warning Retrying an operation without making sure that the operation isn't being recursively triggered can result in the trigger locking up the application. You should always make sure to check the conditions under which a RETRY is occurring.

Examples
-- This error trigger will handle a constraint
-- error, update the value so that the constraint error
-- doesn't happen.  However, if the value has already
-- been changed, then it re-raises the constraint error

CREATE TRIGGER "ErrorTest" ERROR INSERT ON "customer"
BEGIN
   IF ERRORCODE()=1004 THEN
      IF NEWROW.CustNo <> 100 THEN
         SET NEWROW.CustNo=100;
         RETRY;
      ELSE
         RAISE;
      END IF;
   END IF;
END

SQL 2003 Standard Deviations
This statement deviates from the SQL 2003 standard in the following ways:

DeviationDetails
ExtensionThis SQL statement is an ElevateDB extension.
Image