DBMS_SCHEDULER : AUTO_DROP
I know very little about DBMS_SCHEDULER but want to learn how to use it. Basically I want to run a shell script from PL/SQL block immediately (no scheduling). I have written the following job for it.
BEGIN
DBMS_SCHEDULER.create_job (
job_name => 'test',
job_type => 'EXECUTABLE',
job_action => '/rootuser/test.ksh',
enabled => FALSE,
auto_drop => TRUE,
comments => 'Job defined entirely by the CREATE JOB procedure.');
END;
I am running it using:
BEGIN
DBMS_SCHEDULER.run_job(job_name => 'test');
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE(SQLERRM);
END;
I want to know a few things:
- if job test.ksh exits with a non-zero return code does the control goes to EXCEPTION block?
- if job test.ksh exits with a non-zero return code does the job gets dropped?