dbms_scheduler job finihed succesfull when underlying procedure fails
I have a job created with dbms_scheduler which finishes succesfully even when the underlying plsql procedure raises a oracle error.
Is there any way to stop the running job with a failure when the plsql procedure fails and show the oracle error in the all_scheduler_job_run_details.error# column?
Example:
procedure test is
begin raise no_data_found;
end;
dbms_scheduler.create_job(job_name =>'MY_JOB', 'test');
dbms_scheduler.run_job;
when querying all_scheduler_job_run_details I want to see the no_data_found error which occurs in procedure.