Home > APEX_PLSQL_JOB > SUBMIT_PROCESS Function
Previous |
Next |
Use this procedure to submit background PL/SQL. This procedure returns a unique job number. Because you can use this job number as a reference point for other procedures and functions in this package, it may be useful to store it in your own schema.
Syntax
APEX_PLSQL_JOB.SUBMIT_PROCESS ( p_sql IN VARCHAR2, p_when IN DATE DEFAULT SYSDATE, p_status IN VARCHAR2 DEFAULT 'PENDING') RETURN NUMBER;
Parameters
Table: SUBMIT_PROCESS Parameters describes the parameters available in the SUBMIT_PROCESS
function.
SUBMIT_PROCESS Parameters
Parameter | Description |
---|---|
|
The process you wish to run in your job. This can be any valid anonymous block, for example: 'BEGIN <your code> END;' or 'DECLARE <your declaration> BEGIN <your code> END;' |
p_when |
When you want to run it. The default is SYSDATE which means the job will run as soon as possible. You can also set the job to run in the future, for example:
|
p_status |
Plain text status information for this job. |
Example
The following example shows how to use the SUBMIT_PROCESS
function to submit a background process that will start as soon as possible.
DECLARE l_sql VARCHAR2(4000); l_job NUMBER; BEGIN l_sql := 'BEGIN MY_PACKAGE.MY_PROCESS; END;'; l_job := APEX_PLSQL_JOB.SUBMIT_PROCESS( p_sql => l_sql, p_status => 'Background process submitted'); --store l_job for later reference END;