Could you please give more details about your question ?
If you put an EXCEPTION handler BEFORE the insert statement, that exception handler will not catch any error raised when the insert is executed. Exception handlers catch errors raised by instructions between the BEGIN keyword and EXCEPTION.
For example, in this block, do_something will be executed when the execution of some_procedure raise an exception:
What exactly do you want to accomplish ? do you want to catch errors when executing the insert ?
For example, if you want to do something when the insert fails because the record you are trying to insert already exists in the table, you could do something like this:
insert into table_x ......
when dup_val_on_index then
dbms_output.put_line("DUPLICATE RECORD !");
If that is not what you meant, please explain a little more your question.
Last Wiki Answer Submitted: December 12, 2008 3:51 pm by carlosdl63,580 pts.