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