jcs.set_job_name

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

Summary

Set the name of job that is going to be submitted.

By default the name of a job is the description or name of the script that it is for. By changing the job name to some dynamically computed value, the operators will get more information in the job monitor.

The following exceptions can occur when you set a job name:

  • JCS-02041 - when the job does not exist yet/anymore.

Specification

Copy
procedure set_job_name(script in varchar2,
name in varchar2)

Set the name of a job immediately before submitting the job using jcs.submit or jcs.run.

Parameters

  • script - object name (script_name or owner.script_name), possibly with double quotes to specify lower case identifiers
  • name - new name for the job (max 80 characters)

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.

submit_buffer

Specification

Copy
procedure set_job_name(name in varchar2,
can_commit in boolean default true)

Set the name of the current job.

Parameters

  • name - new name for the job (max 80 characters)
  • can_commit - should this be committed immediately?

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.

can_commit

Specification

Copy
procedure set_job_name(job_id in number,
name in varchar2,
can_commit in boolean default true)

Set the name of any existing job.

Parameters

  • job_id - the ID of the job
  • name - new name for the job (max 80 characters)
  • can_commit - should this be committed immediately?

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.

can_commit

Examples

Copy
Using jcs.set_job_name
       create or replace script balance_and_invoice_customers
       is
         cursor c_get_custid is
         select custid
         from   customer;
       begin
         for r in c_get_custid
         loop
           jcs.parameter('BALANCE', 'CUSTID', r.custid);
           jcs.set_job_name('BALANCE', 'Updating balance ' || r.custid);
           jcs.submit('BALANCE');
           commit;
           if jcs.job_statuscode_wait(jcs.last_job_id) = 'C'
           then
             jcs.parameter('INVOICE', 'CUSTID', r.custid);
             jcs.set_job_name('INVOICE', 'Invoicing ' || r.custid);
             jcs.submit('INVOICE');
             commit;
           end if;
         end loop;
       end;

Using jcs.set_job_name

``` Using jcs.set_job_name create or replace script balance ( p_custid in number ) is begin jcs.set_job_name('Updating balance ' || r.custid); -- do the work end;
Copy
<p class="caption">Using jcs.set_job_name</p>

## See Also


*  <a href="jcs/../../../../Development/PL_SQL-API/Packages/jcs/submit.htm">jcs.submit</a>
*  <a href="jcs/../../../../11-Development/PL_SQL-API/Packages/jcs/../../../../Development/PL_SQL-API/Packages/jcs/run.htm">jcs.run</a>