trunc(sysdate + 1) [message #10196] |
Thu, 08 January 2004 05:22 |
patrick
Messages: 83 Registered: December 2000
|
Member |
|
|
I have a question. There is a job and i want it to run everyday at the same time at 1 am. I wrote the following script.
variable jobno number;
begin
dbms_job.submit (:jobno, 'jobname;', trunc(sysdate + 1) + 1/24);
commit;
end;
I am new in SQL so i have the problem of running only once. Tomorrow at 1 am. Can someone help me?
Thank you very much
|
|
|
|
Re: trunc(sysdate + 1) [message #10201 is a reply to message #10196] |
Thu, 08 January 2004 09:31 |
Todd Barry
Messages: 4819 Registered: August 2001
|
Senior Member |
|
|
You did not include the interval parameter, so the job only runs once:
dbms_job.submit (:jobno, 'jobname;', trunc(sysdate + 1) + 1/24, <b>'trunc(sysdate + 1) + 1/24'</b>);
|
|
|
|
Re: trunc(sysdate + 1) i don't get it [message #10216 is a reply to message #10201] |
Thu, 08 January 2004 21:54 |
patrick
Messages: 83 Registered: December 2000
|
Member |
|
|
I used the command but i don't really understand the last part. I understand the sysdate + 1 that means he has to repeat it the following day. But why do i have to put 1/24 behind it again?
when i lookup the result i see the following
JOB NEXT_DATE NEXT_SEC SUBSTR(WHAT,1,35)
---------- --------- -------- -----------------------------------
INTERVAL
--------------------------------------------------------------------------------
6 10-JAN-04 02:00:00 jobname;
trunc(sysdate + 1) + 1/24
Is it correct that it will start on 10-JAN at 2 AM. and then on 11 jan at 2 am? I am not sure.
thank you for answering
Patrick
|
|
|
|
|