DBAsupport.com Forums - Powered by vBulletin
Results 1 to 7 of 7

Thread: DBA_JOBS

  1. #1
    Join Date
    Aug 2000
    Location
    York - England
    Posts
    33
    Hi

    I am trying to submit a job to the job queue and the code is below

    VARIABLE JOBNO NUMBER;
    BEGIN
    DBMS_JOB.SUBMIT(:JOBNO,
    'PACKAGE NAME;', SYSDATE,
    'NEXT_DATE(TRUNC(SYSDATE),"MONDAY") + 09/24');
    END;

    I am gettingt he message that the NEXT_DATE line is inappropriate
    I want the package to run, once a week at 09:00 on a Monday morning irregardless of when it was last run
    Can anyone give me any pointers ??
    Cheers

    :-(
    :p :p :p

  2. #2
    Join Date
    Jun 2000
    Location
    Madrid, Spain
    Posts
    7,447
    Hi

    I thought you could use sysdate + 7

  3. #3
    Join Date
    Aug 2000
    Location
    York - England
    Posts
    33
    Pando

    You can use SYSDATE + 7 but if for some reason the job runs OK on a Monday and then the following Monday it does not run, in fact not until Thursday say, it will run again on the following Thursday
    I want to guarantee it only runs on a Monday

    Cheers
    :p :p :p

  4. #4
    This example returns the date of the next Tuesday after March 15, 1998.

    SELECT NEXT_DAY('15-MAR-98','TUESDAY') "NEXT DAY"
    FROM DUAL;

    NEXT DAY
    ---------

    16-MAR-98
    >>>>>>>>>>>>>>>>>>>
    Why do you need TRUNCATE?

    Ramon Caballero, DBA, rcaballe@yahoo.com

  5. #5
    Join Date
    Aug 2000
    Location
    York - England
    Posts
    33
    I am not a DBA_JOB expert and I am reading from old notes about job submission
    What TRUNC actually does I don't know
    All I do know is that TRUNC is used when you want a job to run exactly at the same time.

    Cheers
    :p :p :p

  6. #6
    Join Date
    Nov 1999
    Location
    Elbert, Colorado, USA
    Posts
    81
    You use truncate to get to a base time of midnight. Then the +9/24 assures you get the job kicked off at 0900. My experience (and apparently that of others) is that if you don't use truncate, you end up with job creep, where the job runs a little later with each iteration.

  7. #7
    Join Date
    Aug 2000
    Location
    York - England
    Posts
    33
    So Carp

    Why can't I get this stupid job submitted then

    Cheers
    :p :p :p

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width