If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Oracle > How to specify a "LAST_DATE" while submitting a job using " DBMS_JOB.SUBMIT" routine

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-15-12, 22:50
saswatic saswatic is offline
Registered User
 
Join Date: Jan 2012
Posts: 2
How to specify a "LAST_DATE" while submitting a job using " DBMS_JOB.SUBMIT" routine

Dear All,

I seek your advice on a recent problem I have faced while submitting a job with DBMS_JOB package as DBMS_SCHEDULER is not available in Oracle 9i and version of my database is 9i.

My requirement is to create a job which will run daily for 30 days only (beginning from the day its started). For Example if I submit the job today then it will run daily once for next 30 days only.

As there is no parameter called : last_date in DBMS_JOB.SUBMIT routine, please help me how to do the same with existing parameters: next_date and interval.

Please find below the snippet I am using.
__________________________________________--
DECLARE
jobno NUMBER;
BEGIN
DBMS_JOB.SUBMIT
(job => jobno
,what => 'begin PKG_Name.Procedure_Name; end;'
,next_date => SYSDATE
---,last_date => SYSDATE+30
,interval => 'SYSDATE+1');
COMMIT;
END;
/
__________________________________________________ ______--

Many Thanks,
Regards
Saswati
Reply With Quote
  #2 (permalink)  
Old 01-15-12, 23:00
anacedent anacedent is offline
Registered User
 
Join Date: Aug 2003
Location: Where the Surf Meets the Turf @Del Mar, CA
Posts: 6,416
DECLARE
jobno NUMBER;
BEGIN
DBMS_JOB.SUBMIT
(job => jobno
,what => 'begin PKG_Name.Procedure_Name; end;'
,next_date => SYSDATE
---,last_date => SYSDATE+30
,interval => 'SYSDATE+1');
DBMS_JOB.BROKEN
(job => jobno
,next_date => SYSDATE+30+1/24);
COMMIT;
END;
/
__________________
You can lead some folks to knowledge, but you can not make them think.
The average person thinks he's above average!
For most folks, they don't know, what they don't know.
Reply With Quote
  #3 (permalink)  
Old 01-16-12, 23:28
saswatic saswatic is offline
Registered User
 
Join Date: Jan 2012
Posts: 2
Thank you for your reply..
But when I try to execute this , the job which is previously submitted becomes broken instantly . But as per my requirement, it should be broken after 30 days..Can you please help in this regard?
Also its helpful if you can explain the column" next date" in the subroutine: DBMS_JOB.Broken

Thanks in Advance,
Saswati
Reply With Quote
  #4 (permalink)  
Old 01-16-12, 23:50
anacedent anacedent is offline
Registered User
 
Join Date: Aug 2003
Location: Where the Surf Meets the Turf @Del Mar, CA
Posts: 6,416
__________________
You can lead some folks to knowledge, but you can not make them think.
The average person thinks he's above average!
For most folks, they don't know, what they don't know.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On