Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Multiple Exception blocks in PL/SQL Stored Procedure

User_19BPUAug 5 2016 — edited Aug 5 2016

Hi,

I want to add multiple Exception blocks for an Begin condition in PL/SQL stored procedure like :-

BEGIN

..

EXCEPTION

    WHEN DUP_VAL_ON_INDEX THEN

DBMS_OUTPUT.PUT_LINE('Error occured at '||SQLCODE||SQLERRM);

Exception

  when others then

dbms_output.put_line('Error occured at '||SQLCODE||SQLERRM);

How I can do it as it is not allowing me to do so? Please let me know how it can fixed? Also whether I can catch the unique constraint error/exception that is thrown in the procedure using  DUP_VAL_ON_INDEX ? Please clarify

    

Thanks

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 2 2016
Added on Aug 5 2016
6 comments
3,482 views