-
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
-
Hi
I thought you could use sysdate + 7
-
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
-
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?
-
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
-
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.
-
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|