Skip to Main Content

SQL & PL/SQL

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!

How to execute more commands on exception section?

GeekintoMay 29 2019 — edited May 29 2019

Hi,

I'm stuck on something small, pls help

So, I have now a block code and i want to execute more commands in EXCEPTION SECTION once specific error accrue.

So, my code like that:

declare

  l_err exception;

  l_check number;

begin

   -- block code ....


   if l_check > 0

   then raise l_err;

   end if;



exception

  when l_err

   then

   -- Action-1: Update flag

   update <table name> set <column name> where id = 100;


   -- Action-2: Log Error

  pkg_err.log( DBMS_UTILITY.FORMAT_ERROR_BACKTRACE );


end;

I found that: Always first action just is executed successfully and 2nd action skipped.

I swapped the actions even check what's going on, So i found the exception skipping any actions after 1st one.

Can you help me pls.

Thanks in advance

Comments
Post Details
Added on May 29 2019
9 comments
260 views