jcs.current_job

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

Summary

Returns information about the current job.

If there is no current job, it returns NULL.

Exceptions

Specification

Copy
function current_job(name in varchar2)
    return varchar2

Parameters

  • name - desired information, one of:
  • 'job_id': Same as jcs.current_job_id
  • 'scheduler_partition': the name of the Partition of the scheduler the job runs on
  • 'scheduler_name': the name of the scheduler the job runs on
  • 'job_owner': the user that submitted the job
  • 'job_user': the user under which the job logs in into the database
  • scheduler parameter: the name of a parameter of the scheduler the job runs on (as found in rs_scheduler_parameters)
  • returns varchar2 - requested value

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.

none

Examples

Copy
Using jcs.current_job
       create or replace function osdep(nt in varchar2, unix in varchar2)
       return varchar2 is
       begin
         if jcs.current_job('os_type') = 'NT'
         then
           return nt;
         else
           return unix;
         end if;
       end;

       create or replace script show_tempdir
       as osdep('dir c:\temp', 'ls /tmp')

Using jcs.current_job