Link to home
Start Free TrialLog in
Avatar of rapace3
rapace3

asked on

dbms_job schedule

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?
Avatar of Naveen Kumar
Naveen Kumar
Flag of India image

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
>cannot make it works?
error messages? -> post them here.
or does the job simply not run? -> use a COMMIT after the dbms_job.submit...
Avatar of rapace3
rapace3

ASKER

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

what tool do you try to run that statement?
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

Avatar of rapace3

ASKER

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;

Avatar of rapace3

ASKER

I had it working using toad.

Please close this question
Glad u cud resolve it urself. Post a refund request in the Community Support zone.
Avatar of rapace3

ASKER

PLEASE CLOSE THIS QUESTION.

I Have figure it oui with TOAD.

Thank you

ASKER CERTIFIED SOLUTION
Avatar of Computer101
Computer101
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial