DBMS_SCHEDULER.CREATE_JOB

Hi,

I have a procedure like pr_test which takes one number type argument.
I want to put this procedure in scheduler to run daily.
But when I create like this

BEGIN
   DBMS_SCHEDULER.CREATE_JOB (
      JOB_NAME          => 'scheld_test,
      JOB_TYPE          => 'STORED_PROCEDURE',
      JOB_ACTION        => 'pr_test (5)',--passing argument 5
      START_DATE        => SYSTIMESTAMP,
      REPEAT_INTERVAL   => 'freq=daily;byhour=1;',
      ENABLED           => FALSE,
      COMMENTS          => 'run daily once at 1 am ');
END;
/

Its  not taking the argument 1 and throwing the error as invalid object.
Can you please let me know how can I schedule the job?

Thanks
GouthamAnandAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

johnsoneSenior Oracle DBACommented:
Check the documentation here -> http://docs.oracle.com/cd/E11882_01/appdev.112/e40758/d_sched.htm#ARPLS72300

It clearly states that you cannot send a parameter when the type is STORED_PROCEDURE.  A recommendation would be to not use that type and use a type of PLSQL_BLOCK.  You shouldn't have to change the action as the begin end is automatically wrapped around the action.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
GouthamAnandAuthor Commented:
Thank you very much.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.