1、raise_application_error:错误数字在-20000到-20999之间的数字。 2、PRAGMA是一个编译指示(或命令)。 编译指示在编译时被处理,它们不在运行时执行。 例如:still_have_employees exception; pragma exception_init(still_have_employees,-20045); begin exception when still_have_employees then .....end; 3、exception_init:不仅有错误数字,还有描述。(并且可以建一个package来集合自定义的exception) create or replace package dynsql is invalid_table_name exception; pragma exception_init(invalid_table_name,-903); invalid_identifier exception; pragma exception_init(invalid_identifier,-904); ....... 现在,就可以在任何程序中跟踪这些错误,就像下面这样: when dynsql.invalid_identifier then...
|
|