Informix 存储过程通用异常处理

Informix stored procedure generic exception handling

我正在尝试在 Informix 中创建一个存储过程。 我想处理在 table

中插入行时发生的所有异常

我遇到了

ON EXCEPTION IN (error code) insert statement END EXCEPTION

用于处理特定的异常(错误代码)。

我的问题是"how can I handle all generic exceptions in Informix"?

在Oracle中,我使用了"EXCEPTION WHEN OTHERS then"语句; Informix 等同于什么?

如在线 documentation 所述,您只是没有定义IN子句。

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.