Skip to Main Content

APEX

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!

Stop processing when Exception is caught

ChrisApexJun 27 2018 — edited Jun 27 2018

I try break process after exception is true .  when  exception  is caught  it will rollback and stop but i dont know that how to exit . i read concept apex_application.stop_apex_engine; but i confused with how to using

I input deptno > table dept checkdata if not > exception is caught > it wont run Process  insert into dept(deptno,dname) values (71,'TEST') ;

this my code

DECLARE

xtest number:=null;  

BEGIN

SAVEPOINT A;

   adjust_insert

(SEQ_EMP.nextval, :TF_EMP_NAME, :DP_DATE,  :RG_JOB, :NF_SALARY,:PL_MANAGER,:NF_COM,:SL_DEPT);

insert into x1 (c2) values ('insert emp success');

begin --Sub-block begin

select deptno into xtest from dept

where deptno=:P2_NEW;  

                EXCEPTION

                       WHEN NO_DATA_FOUND THEN 

ROLLBACK to SAVEPOINT  A;  insert into x1 (c2) values ('nodatafound &rollbCK'); --I want to stop process if not found data

                       WHEN others THEN  --Rollback all the changes and then raise the error again.

ROLLBACK to SAVEPOINT A; insert into x1(c2) values ('other&rollbCK'); --- TO A;   

end;    --Sub-block end

     insert into dept(deptno,dname) values (71,'TEST');

 

END;

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 25 2018
Added on Jun 27 2018
2 comments
450 views