ORACLE-005: Create Job (ii)

Source: Internet
Author: User

If you need to create a job with parameters, how to create it.

We declare the parameters directly, assign them, and then pass the stored procedure to the job call.

For example, the stored procedure is named Pro_test_job, and the parameters have one, which is the VARCHAR2 type.

Create the job as follows:

declare  job number;  V_count number;begin     SELECT Count (*) into    v_count from    user_jobs uj    WHERE  upper (uj.what) =     UPPER (' Declare para_data VARCHAR2 (100): = ' parameter '; begin  Pro_test_job (para_data); end; ');        If V_count = 0 Then      sys.dbms_job.submit (Job + job, what = '                       declare para_data VARCHAR2 (100): = ' parameter "; Begin  Pro_test_job (para_data); end; ',                       next_date =>sysdate,                       interval = ' sysdate+2/24 ');    Dbms_job.run (Job);    commit;  End If;end;


ORACLE-005: Create Job (ii)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.