Click here to Skip to main content
15,893,588 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a requirement to run multiple pl sql procedures in a sequential order by scheduling in DBMS_Scheduler. Can we accomplish it by creating main proc by calling all these procs to run sequential order and the execution gets stopped if any of the proc gets failed
Also i'd like to capture the exception handling as well?

What I have tried:

CREATE OR REPLACE

PROCEDURE RUN_JOBS AS

BEGIN

PROCEDURE1;

PROCEDURE2;

PROCEDURE3;

PROCEDURE4;

PROCEDURE5;

exceptions

when others then

dbms_output.put_line('error::'||SQLERRM);

err_num := SQLCODE;

err_msg := SUBSTR(SQLERRM, 1, 100);

insert into tmp_log (no,err_message) values(1,SQLERRM);

END;

/
Posted
Updated 30-Apr-18 4:03am

1 solution

You can simply create a SQL Job and add the steps into jobs and execute the Stored procedure in that. For error handling, you can use try & catch inside the stored procedure itself.
Job having steps so you can manage like if previous steps failed the stop executing the next steps.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900