Solved

dbms_job schedule

Posted on 2007-12-05
11
2,792 Views
Last Modified: 2013-12-18
I am trying to schedule this stored procedure using dbms_job

  dbms_job.submit(job_no,'pr_fs_del('DEC-07');',sysdate + 30/1440,'sysdate + 60/1440');
cannot make it works?
0
Comment
Question by:rapace3
  • 4
  • 2
  • 2
  • +2
11 Comments
 
LVL 28

Expert Comment

by:Naveen Kumar
Comment Utility
Try the below ;

dbms_job.submit(job_no,'begin pr_fs_del(''DEC-07''); end;',sysdate + 30/1440,'sysdate + 60/1440');

I assume job_no is a pl/sql variable. This variable will be assigned with job no once the job is submitted which you see by using dbms_output.put_line(..)

Thanks
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
Comment Utility
>cannot make it works?
error messages? -> post them here.
or does the job simply not run? -> use a COMMIT after the dbms_job.submit...
0
 

Author Comment

by:rapace3
Comment Utility
dbms_job.submit(job_no,'begin pr_fs_del(''DEC-07''); end;',sysdate + 30/1440,'sysdate + 60/1440');
causes this error
Oracle Error :: ORA-00900
invalid SQL statement

0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
Comment Utility
what tool do you try to run that statement?
0
 
LVL 28

Expert Comment

by:Naveen Kumar
Comment Utility
Can you try the below :

SQL> begin dbms_job.submit(job_no,'begin pr_fs_del(''DEC-07''); end;',sysdate + 30/1440,'sysdate + 60/1440'); commit; end;
/

Thanks

0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:rapace3
Comment Utility
using TOAD
here is the answer
DECLARE
  X NUMBER;
BEGIN
  SYS.DBMS_JOB.SUBMIT
    ( job       => X
     ,what      => 'pr_fs_del(''NOV-07'');'
     ,next_date => to_date('07/12/2007 09:30:00','dd/mm/yyyy hh24:mi:ss')
     ,interval  => 'SYSDATE+30/1440 '
     ,no_parse  => TRUE
    );
  SYS.DBMS_OUTPUT.PUT_LINE('Job Number is: ' || to_char(x));
END;
/

commit;

0
 

Author Comment

by:rapace3
Comment Utility
I had it working using toad.

Please close this question
0
 
LVL 18

Expert Comment

by:Jinesh Kamdar
Comment Utility
Glad u cud resolve it urself. Post a refund request in the Community Support zone.
0
 

Author Comment

by:rapace3
Comment Utility
PLEASE CLOSE THIS QUESTION.

I Have figure it oui with TOAD.

Thank you

0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
Comment Utility
PAQed with points refunded (125)

Computer101
EE Admin
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Read about achieving the basic levels of HRIS security in the workplace.
Via a live example, show how to take different types of Oracle backups using RMAN.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

743 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now