Home » RDBMS Server » Server Administration » Schedule to run job on the last date (monthly)
Schedule to run job on the last date (monthly) [message #60286] Fri, 30 January 2004 09:23 Go to next message
Jadie
Messages: 64
Registered: January 2002
Member
 

Can anyone tell me how set up the interval to run the scheduling job on the last date of every month?

Thanks...

Jadie
Re: Schedule to run job on the last date (monthly) [message #60292 is a reply to message #60286] Fri, 30 January 2004 12:05 Go to previous messageGo to next message
billh
Messages: 35
Registered: August 1999
Member
set the interval to
if your current run date is the last day of the month then next run date is "last_day(sysdate +1)"

if your current run date is not the last day of the month and you want the next run date to be the last day of next month then next run date is
"last_day(last_day(sysdate) +1)"

example:
SQL> select last_day(sysdate+1) from dual ;

LAST_DAY(
---------
31-JAN-04

SQL> select last_day(last_day(sysdate) + 1) from dual ;

LAST_DAY(
---------
29-FEB-04
Re: Schedule to run job on the last date (monthly) [message #60295 is a reply to message #60286] Fri, 30 January 2004 12:16 Go to previous message
Satish Shrikhande
Messages: 167
Registered: October 2001
Senior Member
variable jobno number;
begin
dbms_job.submit(:jobno,'proc_Calljim;',last_day(sysdate),'last_day(sysdate+1)');
end;

select * from user_jobs;

This will set the jon on 01/31/2004 first time and then the next execution will be on 01/29/2004 .

I hope this will help you

Satish Shrikhande
http://www.freewebs.com/oracledba/oracle.htm
Previous Topic: default temporary tablespace and database properties view
Next Topic: Invalidated Stored Procedure
Goto Forum:
  


Current Time: Fri Sep 20 10:30:43 CDT 2024