Search code examples
plsqloracle-apex

How to update a parameter in a job in Oracle SQL


I have just created a job using SQL Developer build-in wizard and i would like to change the parameters of the created job from my application. The job is launching a stored procedure every day at 7 o'clock.

In the application I have two fields:

  1. Disable: true/false
  2. Hour: 10:00

And this is my job and fields I would like to update depending on what was selected in the app:

enter image description here

I see two ways of doing it:

  1. Make the fields dependent on the values in the table
  2. Make a pl/sql block that updates the values

Of course I don't know how to do it (in the first option the select statement doesn't work and in the second I don't know how to acces the jobs fields)

Please help


Solution

  • Begin 
    dbms_scheduler.disable( 'ATOS."job_email_notifications"' );
    
    DBMS_SCHEDULER.SET_ATTRIBUTE ( name => 'ATOS."job_email_notifications"', attribute => 'repeat_interval', value => 'freq=daily;byday=FRI,SAT;byhour=20;byminute=0; bysecond=0');--change value--as per need
    
    dbms_scheduler.enable( 'ATOS."job_email_notifications"' );
    End;
    /