Разгледайте:
WHENEVER SQLERROR
http://download.oracle.com/docs /cd/E11882_01/server.112/e16604/ch_twelve052.htm
ВСЕКИ КОГАТО OSERROR
http://download.oracle.com/docs /cd/E11882_01/server.112/e16604/ch_twelve051.htm
Разгледайте:
WHENEVER SQLERROR
http://download.oracle.com/docs /cd/E11882_01/server.112/e16604/ch_twelve052.htm
ВСЕКИ КОГАТО OSERROR
http://download.oracle.com/docs /cd/E11882_01/server.112/e16604/ch_twelve051.htm