Name

CREATE_JOB

Synopsis

This program creates a job to be executed either immediately or later. It is overloaded as four versions, all procedures.

Procedure—Version 1 (no named objects)

This version is the quickest way to create a job. It accepts all of the components needed to creat a job (e.g., calendar, job action) defined in a granular manner without explicit names.

Parameter name

Datatype

Description

job_name

VARCHAR2

Name of the job.

job_type

VARCHAR2

Type of the job. Valid values are PLSQL_BLOCK, STORED_PROCEDURE, and EXECUTABLE.

job_action

VARCHAR2

What the job actually does. It depends on the previous parameter. If job_type is PLSQL_BLOCK, this is the entire PL/SQL block. STORED_PROCEDURE requires the name of the stored procedure. EXECUTABLE requires the name of the OS executable with the full path.

number_of_arguments

PLS_INTEGER

If the job’s action, as shown in the previous parameter, accepts some input parameter, then the number of parameters is shown here. Default is 0.

start_date

TIMESTAMP WITH TIMEZONE

Date and time the job is to start. If this is NULL (the default), then the job starts immediately.

repeat_interval

VARCHAR2

Calendar string, which determines when the job should repeat—for example, “FREQ=DAILY BYHOUR=3”. For a complete list of values in the calendar string, see Chapter 8. Default is NULL, which indicates that the job will never be repeated; it will be executed only once at the start_date.

end_date

TIMESTAMP WITH TIMEZONE

If set, this ...

Get Oracle PL/SQL for DBAs now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.