Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

DBMS_SCHEDULER.CREATE_JOB and RUN_JOB issue ...

bondursDec 8 2016 — edited Dec 12 2016

Greetings all:

We are currently using Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production

I'm having an issue with running jobs using the DB scheduler.  Essentially, I have set my job up as follows:

  DBMS_SCHEDULER.CREATE_JOB (

    job_name             => 'job_name',

     job_type             => 'PLSQL_BLOCK',

     job_action           => 'BEGIN PHS_FILE_UPLOAD.LoadDataFiles('||inPrvsnlHldProcGrpHistID||','||inPrvsnlHldFileTypeID||'); END;',

     enabled              =>  TRUE,

     auto_drop            => TRUE,

     comments             => 'Files load in the database in the background.');

  DBMS_SCHEDULER.RUN_JOB('job_name',FALSE);  (I've also had the 2nd parameter set to TRUE)

These 2 statements are run from an existing database package, which is called from an APEX application.  The job will run and run properly, but it runs twice every time this command is executed.  I only want the job to run once when called.  The job is essentially populating a table from an external table on the file system. 

This job needs to be run on demand by the user from within the APEX application.  Does anyone have any recommendations on how I can solve this issue?

Thanks,

Stan

This post has been answered by Gbenga Ajakaye on Dec 8 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 6 2017
Added on Dec 8 2016
6 comments
7,071 views