Home » SQL & PL/SQL » SQL & PL/SQL » DBMS_JOB TO run every saturday starting next saturday (oracle 11g Release2)
DBMS_JOB TO run every saturday starting next saturday [message #634999] |
Wed, 18 March 2015 15:09  |
azeem87
Messages: 116 Registered: September 2005 Location: dallas
|
Senior Member |
|
|
hi,
I have to deploy the code this week, but the job should start from
saturday 03/28/2015 12.30 AM and from there on every saturday at 12.30 am should run every week
i have this code, please advice what should be on interval value/next date
DECLARE
X NUMBER;
BEGIN
SYS.DBMS_JOB.SUBMIT
( job => X
,what => 'TEST_PROC(33);'
,next_date => next_day(sysdate,'sat')
,interval => xxxxxxx
,no_parse => FALSE
);
COMMIT;
END;
/
Thanks
|
|
|
|
|
|
Re: DBMS_JOB TO run every saturday starting next saturday [message #635003 is a reply to message #635002] |
Wed, 18 March 2015 17:39   |
azeem87
Messages: 116 Registered: September 2005 Location: dallas
|
Senior Member |
|
|
Thanks all for your time,
DECLARE
X NUMBER;
BEGIN
SYS.DBMS_JOB.SUBMIT
( job => X,
what => TEST_PROC(63);',
next_date=>to_date('03/28/2015 12.30 AM','MM/DD/YYYY HH:MI AM'),
interval => 'trunc(next_day(sysdate,'SAT'))+1/2+1/48',
no_parse => FALSE
);
COMMIT;
END;
/
I am getting this error, am i missing anything there.
Error at line 1
ORA-06550: line 8, column 41:
PLS-00103: Encountered the symbol "SAT" when expecting one of the following:
) , * & = - + < / > at in is mod remainder not rem
<an exponent (**)> <> or != or ~= >= <= <> and or like like2
like4 likec between || multiset member submultiset
The symbol ", was inserted before "SAT" to continue.
|
|
|
|
Re: DBMS_JOB TO run every saturday starting next saturday [message #635161 is a reply to message #635011] |
Mon, 23 March 2015 09:35  |
azeem87
Messages: 116 Registered: September 2005 Location: dallas
|
Senior Member |
|
|
thanks i had it corrected and deployed and the code is below,
it ran sucessfully First run was good on time and it ran at 12.30 am.
but Next date shows the next schedule job is at 12.30 PM
Next Date 3/28/2015 12:30:00 PM
DECLARE
X NUMBER;
BEGIN
SYS.DBMS_JOB.SUBMIT
( job => X,
what => 'TEST_PROC(63);',
next_date=>to_date('03/21/2015 12.30 AM','MM/DD/YYYY HH:MI AM'),
interval =>'trunc(next_day(sysdate,''SAT''))+1/2+1/48',
no_parse => FALSE
);
COMMIT;
END;
/
is my format wrong in next date column for job creation code.
Thanks Again for your help.
|
|
|
Goto Forum:
Current Time: Sat May 17 10:53:01 CDT 2025
|