I am trying to create a stored procedure in Informix. I want to handle all exceptions that occur while inserting a row in a table
I came across
ON EXCEPTION IN (error code) insert statement END EXCEPTION
which is used to handle a specific exception(error code).
My question is "how can I handle all generic exceptions in Informix"?
In Oracle, I have used "EXCEPTION WHEN OTHERS then" statement; what is the Informix equivalent to the same?
As described in the online documentation , you just do not define the IN
clause.
The ON EXCEPTION statement, together with the RAISE EXCEPTION statement, provides an error-trapping and error-recovery mechanism for SPL routines. ON EXCEPTION can specify the errors that you want to trap as the SPL routine executes, and specifies the action to take if the error occurs within the statement block. The ON EXCEPTION statement can list one or more specific error numbers in the IN clause, or it can trap all errors (or any error) if the IN clause is omitted.