The following lines contain the word 'select', 'insert', 'update' or 'delete':
l_update_name varchar2(30) := 'cnupreas.sql';
select /*+ ROWID(r) */ r.upd_table_id,
r.updated_table,
decode(r.lookup_type, 'ANALYST_NOTE_REASON', dbms_lob.substr(r.reason),
l.meaning) note,
decode(r.lookup_type, 'ANALYST_NOTE_REASON',
decode(r.reason_code, 'USER_DEFINED', 'CN_USER', 'CN_SYSGEN'),
'CN_SYSGEN') note_type,
r.reason_id, r.created_by, r.creation_date, 0 id, r.rowid rowid1
from cn_reasons_all r, cn_lookups l
where r.rowid between l_start_rowid and l_end_rowid
and r.attribute1 is null
and l.lookup_type (+) = r.lookup_type
and l.lookup_code (+) = r.reason_code;
ad_parallel_updates_pkg.initialize_rowid_range(
ad_parallel_updates_pkg.ROWID_RANGE,
l_table_owner,
l_table_name,
l_update_name,
X_worker_id,
X_num_workers,
X_batch_size, 0);
ad_parallel_updates_pkg.get_rowid_range(
l_start_rowid,
l_end_rowid,
l_any_rows_to_process,
X_batch_size,
TRUE);
delete /*+ ROWID(r) */ from cn_reasons_all r
where rowid between l_start_rowid and l_end_rowid
and (updated_table = 'CN_PAYMENT_WORKSHEETS' and not exists
(select 1 from cn_payment_worksheets_all
where payment_worksheet_id = upd_table_id)
or updated_table = 'CN_PAYRUNS' and not exists
(select 1 from cn_payruns_all
where payrun_id = upd_table_id));
update cn_reasons_all
set attribute1 = x_note_id_tbl(c)
where reason_id = l_reas_id_tbl(c)
and rowid = l_rowid_tbl(c);
ad_parallel_updates_pkg.processed_rowid_range(
l_rows_processed,
l_end_rowid);
ad_parallel_updates_pkg.get_rowid_range(
l_start_rowid,
l_end_rowid,
l_any_rows_to_process,
X_batch_size,
FALSE);