I have some Oracle jobs running. In each job I have set up a PL/SQL exception handler that sends an email to developers if there is an error encountered in the code the job runs. Is there a way for me to know in the exception handler the job number so I can include that in the email?
Something like:
BEGIN
Run_This_Plsql();
EXCEPTION WHEN OTHERS DO
DECLARE
job_number VARCHAR2(64);
BEGIN
job_number := --This would be the job number of the currently running job
Send_email(job_number, subject, recipient, from);
END;
END;