If I am running package from a scheduler job. How do I get the name of the job that is running me?
When I look at sys_context. I see BG_JOB_ID and FG_JOB_ID. I think BG_JOB_ID is for oracle like, SMON, but having a sys_context for that doesnt make sense. Do I use these?
Basically, I need to go to DBA_SCHEDULER_JOB_RUN_DETAILS and get the time that my last job ran. I use that in my package. I'd rather not add my own table to store this since it would be redundant. I don't want to hard code the job name, because that is denormalized and the job name could change and I forget to change my package. This would lead to a run time bug.