Home » SQL & PL/SQL » SQL & PL/SQL » How to schedule a job at a certain time?
How to schedule a job at a certain time? [message #37552] Wed, 13 February 2002 23:13 Go to next message
Cherilyn Tan
Messages: 2
Registered: November 2001
Junior Member
Hi,
I would like to execute a job using dbms_job.submit. To avoid an execution drift, I set the interval to be 'trunc(sysdate + 1, "hh24")'. How do avoid getting an error? Below is an extract of my code:

SQL> variable jobno number;
SQL> begin
2 dbms_job.submit(:jobno,'sp_name',to_date("14-feb-2002 17:01","dd-mon-yyyy hh24:mi"),trunc(sysdate + 1,"hh24"));
3 commit;
4 end;
SQL> /
to_date("14-feb-2002 17:01","dd-mon-yyyy hh24:mi"),
*
ERROR at line 3:
ORA-06550: line 3, column 9:
PLS-00201: identifier '14-feb-2002 17:01' must be declared
ORA-06550: line 2, column 1:
PL/SQL: Statement ignored
Re: How to schedule a job at a certain time? [message #37554 is a reply to message #37552] Thu, 14 February 2002 00:51 Go to previous messageGo to next message
pratap kumar tripathy
Messages: 660
Registered: January 2002
Senior Member
declare
job_no number;
begin
DBMS_JOB.SUBMIT(job_no,
'sp_name;',
next_date => SYSDATE,
interval => 'SYSDATE+1',
no_parse => FALSE); /* Job runs in every day */
commit;
end;
/
Re: How to schedule a job at a certain time? [message #37577 is a reply to message #37552] Thu, 14 February 2002 12:20 Go to previous message
Suresh Vemulapalli
Messages: 624
Registered: August 2000
Senior Member
i think u r using double quotes..

SQL> variable jobno number;
SQL> begin
2 dbms_job.submit(:jobno,'sp_name;',to_date('14-feb-2002 17:01','dd-mon-yyyy hh24:mi'),trunc(sysdate + 1,''hh24''));
3 commit;
4 end;
SQL> /

Note: use single quotes only (''=> 2 single quotes)
Previous Topic: SQLPlus trimming spaces in spool file
Next Topic: how do i create a plsql type ..like table
Goto Forum:
  


Current Time: Fri Sep 24 16:56:33 CDT 2021