Hi Guys,
I created a job by using DBMS_JOB.SUBMIT(....);
when i say print jobno:
JOBNO
------
21
Now i want to run this job no 21 on every sunday morning 03:00:00 am. i tried it using dbms.next_date(sysdate,'sysdate+7);
but where to give sunday and time also??
Can any one help me how to put my job to run on every sunday ,please.
It would be very helpful if i can get sequence of steps. becuase i've to do it on production which in turn calls some other packages.
PROD>>begin
2 DBMS_JOB.SUBMIT(:jobno, 'CALL_WEEKLY;',
3 sysdate,
4 'NEXT_DAY(TRUNC(SYSDATE),''SUNDAY"")+3/24');
5 end;
6 /
begin
*
ERROR at line 1:
ORA-23319: parameter value "NEXT_DAY(TRUNC(SYSDATE),'SUNDAY"")+3/24" is not
appropriate
ORA-06512: at "SYS.DBMS_JOB", line 57
ORA-06512: at "SYS.DBMS_JOB", line 132
ORA-06512: at line 2
PROD>>VARIABLE jobno NUMBER
PROD>>begin
2 DBMS_JOB.SUBMIT(:jobno, 'CALL_WEEKLY;',
3 sysdate,
4 'NEXT_DAY(TRUNC(SYSDATE),''SUNDAY"")+3/24');
5 end;
6 /
begin
*
ERROR at line 1:
ORA-23319: parameter value "NEXT_DAY(TRUNC(SYSDATE),'SUNDAY"")+3/24" is not
appropriate
ORA-06512: at "SYS.DBMS_JOB", line 57
ORA-06512: at "SYS.DBMS_JOB", line 132
ORA-06512: at line 2
There has been a typo in Julian's message that you have addopted in all of your following tries. There should be two single quote characters around SUNDAY, before and after it. In Julian's message there are two single quotes before and two double quotes after the name of the day. So the following should work for you (if you have NLS_LANGUAGE set to AMERICAN):
Code:
begin
DBMS_JOB.SUBMIT(:jobno, 'CALL_WEEKLY;',
sysdate,
'NEXT_DAY(TRUNC(SYSDATE),''SUNDAY'')+3/24');
end;
/
Jurij Modic ASCII a stupid question, get a stupid ANSI
24 hours in a day .... 24 beer in a case .... coincidence?
Bookmarks