PL/SQL API jcs.set_job_name
Summary
- procedure set_job_name(script in varchar2, name in varchar2)
- procedure set_job_name(name in varchar2, can_commit in boolean)
- procedure set_job_name(job_id in number, name in varchar2, can_commit in boolean) ( In version 9 it is not possible to set the name of a job in a final state, where it was allowed in previous versions.Trailing spaces are trimmedThe job name is silently truncated to the maximum length, which is 80 characters in v6/7 and 255 in v8When passing an empty name the exception ORA-20000: JCS-MULTI: Modification vetoed: JCS-102074: Field Description on Job ... (submitted from ...) must be specified is thrown instead of ORA-01407: cannot update ("SYSJCS"."RWS_JOB$"."NAME") to NULL )
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
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
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
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
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;<p class="FigureParagraph">Using jcs.set_job_name</p>
## See Also
* <a href="jcs/submit">jcs.submit</a>
* <a href="jcs/run">jcs.run</a>
<div class="topic"><p>plsqlTopic</p></div>
<div class="topic"><p>onsiteTopic</p></div>