[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

dbms job submit

Posted on 2014-08-21
5
Medium Priority
?
313 Views
Last Modified: 2014-08-21
I want to schedule the job to run on the 1st of every month. I have the code and wanted to be sure if this is correct before I schedule.

runs on september  1st 2014 and there on every 1st of the month

--dbms job run every 1st of the month for monthly proposed annual goal report
DECLARE
    x   NUMBER;
BEGIN
dbms_job.submit(job => X,
                what => 'mthly_prop_goal_imp_prc;' ,
                next_date => trunc(add_months(sysdate, 1), 'mm'),
                interval => 'trunc(add_months(sysdate, 1), 'mm')',
                no_parse => true);
commit;
end;
0
Comment
Question by:anumoses
  • 3
  • 2
5 Comments
 
LVL 78

Accepted Solution

by:
slightwv (䄆 Netminder) earned 2000 total points
ID: 40276273
Looks good to me.
0
 
LVL 78

Assisted Solution

by:slightwv (䄆 Netminder)
slightwv (䄆 Netminder) earned 2000 total points
ID: 40276279
You can always create the job and check to see if the run dates are correct:

select to_char(job) job,
    what,
    to_char(last_date,'MM/DD/YYYY HH24:MI') last_date,
    to_char(this_date,'MM/DD/YYYY HH24:MI') this_date,
    to_char(next_date,'MM/DD/YYYY HH24:MI') nexT_date 
from user_jobs
/

Open in new window

0
 
LVL 6

Author Comment

by:anumoses
ID: 40276288
just one question though

interval => 'trunc(add_months(sysdate, 1), 'mm')',

does mm has to be ''mm''
0
 
LVL 78

Assisted Solution

by:slightwv (䄆 Netminder)
slightwv (䄆 Netminder) earned 2000 total points
ID: 40276299
>>does mm has to be ''mm''

Probably.
0
 
LVL 6

Author Closing Comment

by:anumoses
ID: 40276323
thanks
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question