An Oracle Database developer* contacted me recently with this problem: Do you know a way to get the DBMS_SCHEDULER Job Name from within the code that is being executed by the job? I could have told him to visit the OTN SQL and PL/SQL Forum and post his question there, but I thought that instead I would ask the players at the PL/SQL Challenge if they had any ideas. So I posted this message in the Recent News section: Solution from Niels Hecker -- the user needs the following privileges directly assigned: -- EXECUTE on package DBMS_Lock -- SELECT ANY DICTIONARY -- CREATE JOB ------------------------------------------------------------------ -- create logging-table with associated log-procedure CREATE TABLE tbl_LogMsg ( ID INTEGER, Stamp TIMESTAMP(3), Msg VARCHAR2(4000) ); CREATE SEQUENCE seq_LogMsg#ID START WITH 0 INCREMENT BY 1 MINVALUE 0 MAXVALUE 4294967295 ORDER NOCACHE NOCYCLE; CREATE OR REPLACE PROCEDURE LogMsg (pM...
For the last twenty years, I have managed to transform an obsession with PL/SQL into a paying job. How cool is that?