jcs.job_status_wait

on-site-related topic PL/SQL API jcs.job_status_wait

Summary

Wait until the indicated job is in a finished state and return the job's status.

Until that time, if this is called from a job, the calling job gets status WAITING (W).

A job is in a finished state when its status level is equal or greater than 4; this means this routine will return CANCELED, UNKNOWN, ERROR, COMPLETED, KILLED or DELETING.

The following exceptions can occur when you wait for a job:

  • JCS-02191 - when the timeout has expired.
  • JCS-02041 - when the job does not exist yet/anymore.

Specification

Copy
function job_status_wait(job_id in number,
timeout in number default null)
    return varchar2

Parameters

  • job_id - the ID of the job to wait for
  • timeout - number of seconds to wait
  • returns varchar2 - the status of the job

Transaction keyword

The transaction keyword defines how and/or when the changes are committed to the database. A definition of the various transaction keywords can be found on the jcs package summary page.

autonomous

Examples

Copy
Using jcs.job_status_wait
       ...
       jcs.submit(...);
       commit;
       jcs_out.put_line('Job is now ' || jcs.job_status_wait(jcs.last_job_id));

Using jcs.job_status_wait

See Also