The DEFINE_PROGRAM_ARGUMENT procedure defines the name or default value of a program argument.
If no default value is defined for a program argument, the job that references the program must provide an argument value. The job can also override the default value.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition provides only the MySQL mode.
Syntax
PROCEDURE define_program_argument(
program_name IN VARCHAR2,
argument_position IN PLS_INTEGER,
argument_name IN VARCHAR2 DEFAULT NULL,
argument_type IN VARCHAR2,
default_value IN VARCHAR2,
out_argument IN BOOLEAN DEFAULT FALSE);
Parameters
| Parameter | Description |
|---|---|
| program_name | The name of the program to change. A program with this name must exist. |
| argument_position | The location of the argument when it is passed to the executable file. The number of program arguments is specified by the number_of_arguments parameter. |
| argument_name | The name to assign to the argument. The argument_name parameter is optional. However, if you specify the argument_name parameter, it must be unique in the program. If you specify a name for an argument, the argument can be used by other procedures based on the name. |
| argument_type | The data type of the argument to be defined. The Scheduler does not validate or use this parameter. The program user uses the argument_type parameter to assign values to the argument. The parameter supports all valid SQL data types. |
| default_value | The default value assigned to the argument if the job does not specify the argument. |
| out_argument | This parameter is not in use and must be set to FALSE. |
Considerations
Before a program is enabled, you must define all program arguments from 1 to the value of the number_of_arguments parameter. If you do not use this procedure to define the default value of an argument, you must define its value in the job.
The DEFINE_PROGRAM_ARGUMENT procedure supports only the arguments of SQL type. Therefore, program or job arguments do not support non-SQL argument values, such as BOOLEAN values.
Examples
BEGIN
dbms_scheduler.define_program_argument(program_name => 'CIDPPROGRAM_', argument_position => 1, argument_type => 'int', default_value => '0', out_argument => false);
COMMIT;
END;/