The DEFINE_PROGRAM_ARGUMENT procedure is used to define the name or default value of a program argument.
If no default value is defined for a program argument, the job that references this program must provide the argument value (the job can also override the default value).
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition does not support this feature.
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 be modified. A program with this name must exist. |
| argument_position | The position at which the argument is passed to the executable file. number_of_arguments specifies the number of arguments for the program. |
| argument_name | The name to be assigned to the argument. argument_name is optional, but if specified, it must be unique for the program. If a name is specified, it can be used by other procedures. |
| argument_type | The data type of the defined argument. The scheduler does not validate or use this option. When assigning a value to the argument, the program user needs to use argument_type. Any valid SQL data type is supported. |
| default_value | If the job does not specify the argument, this default value is assigned to the argument. |
| out_argument | This parameter is not used and must be set to FALSE. |
Considerations
Before enabling the program, all program arguments from 1 to the value of number_of_arguments must be defined. If the default value of the argument is not defined using this procedure, the value must be defined in the job.
DEFINE_PROGRAM_ARGUMENT only supports SQL-type arguments. Therefore, program or job arguments do not support non-SQL-type parameter 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;/
