11g_job performing procedure with parameters

Source: Internet
Author: User

One of the existing parameters is a date type of storage:
Date )  as  begin       Dbms_outputput_line (To_char (T_var, ' YYYY '));        --dbms_output. put_line (T_var);   End;   

The implementation code for the job is:

begin      Dbms_scheduler. create_job (          = ' FFFF ',          = = ' Stored_procedure ',                 //Indicates that the job is executing a stored procedure type        = ' "Schema". " Procedure "',           //Indicates which stored procedure is executed (in the name of the store), the stored procedure cannot have input and output parameters and output parameters.         = = 1,                       //The job's execution program has a parameter number        of 1= ' freq=daily;interval=3 ',     // Indicates that 3 points per day is the time        to execute the job FALSE                                //Indicates whether the job is enabled, note case        );    End;  

After the job definition is complete, set the value of the job's parameters:

begin      Dbms_scheduler. set_job_argument_value (                     = ' FFFF ',                               = 1,                                                             = = sysdate          )     ;  End;  

The parameter Argument_position = 1 represents the location of the job's parameters, and if there are multiple parameters in the job, write as 2,3,4 .... increments by 1. Note: If there are multiple parameters that need to be written

begin Dbms_scheduler.Set_job_argument_value (job_name= ' FFFF ',argument_position= 1,Argument_value=sysdate); Dbms_scheduler.Set_job_argument_value (job_name= ' FFFF ',argument_position= 2,Argument_value=val2); Dbms_scheduler.Set_job_argument_value (job_name= ' FFFF ',argument_position= 3,Argument_value=val3); ......End;

Job parameter settings, support for VARCHAR2 and date type parameters

Enable job and execute job:
EXEC Dbms_scheduler. ENABLE (' FFFF ');   EXEC Dbms_scheduler. Run_job (' FFFF ');  

11g_job performing procedure with parameters

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.