The following lines contain the word 'select', 'insert', 'update' or 'delete':
select hold_source_id
from so_hold_sources
where hold_entity_id in (select m.duplicate_site_id
from ra_customer_merges m
where m.process_flag = 'N'
and m.request_id = req_id
and m.set_number = set_num)
and hold_entity_code = 'STS'
for update nowait;
select hold_source_id
from so_hold_sources
where hold_entity_id in (select m.duplicate_site_id
from ra_customer_merges m
where m.process_flag = 'N'
and m.request_id = req_id
and m.set_number = set_num)
and hold_entity_code = 'ITS'
for update nowait;
select hold_source_id
from so_hold_sources
where hold_entity_id in (select m.duplicate_site_id
from ra_customer_merges m
where m.process_flag = 'N'
and m.request_id = req_id
and m.set_number = set_num)
and hold_entity_code = 'S'
for update nowait;
select hold_source_id
from so_hold_sources
where hold_entity_id in (select m.duplicate_id
from ra_customer_merges m
where m.process_flag = 'N'
and m.request_id = req_id
and m.set_number = set_num)
and hold_entity_code = 'C'
for update nowait;
/* site level update */
arp_message.set_name( 'AR', 'AR_UPDATING_TABLE');
UPDATE SO_HOLD_SOURCES a
set (hold_entity_id) = (select distinct m.customer_site_id
from ra_customer_merges m
where a.hold_entity_id =
m.duplicate_site_id
and m.request_id = req_id
and m.process_flag = 'N'
and m.set_number = set_num),
last_update_date = sysdate,
last_updated_by = arp_standard.profile.user_id,
last_update_login = arp_standard.profile.last_update_login
where hold_entity_id in (select m.duplicate_site_id
from ra_customer_merges m
where m.process_flag = 'N'
and m.request_id = req_id
and m.set_number = set_num)
and hold_entity_code = 'STS';
arp_message.set_name( 'AR', 'AR_ROWS_UPDATED' );
/* site level update */
arp_message.set_name( 'AR', 'AR_UPDATING_TABLE');
UPDATE SO_HOLD_SOURCES a
set (hold_entity_id) = (select distinct m.customer_site_id
from ra_customer_merges m
where a.hold_entity_id =
m.duplicate_site_id
and m.request_id = req_id
and m.process_flag = 'N'
and m.set_number = set_num),
last_update_date = sysdate,
last_updated_by = arp_standard.profile.user_id,
last_update_login = arp_standard.profile.last_update_login
where hold_entity_id in (select m.duplicate_site_id
from ra_customer_merges m
where m.process_flag = 'N'
and m.request_id = req_id
and m.set_number = set_num)
and hold_entity_code = 'ITS';
arp_message.set_name( 'AR', 'AR_ROWS_UPDATED' );
/* site level update */
arp_message.set_name( 'AR', 'AR_UPDATING_TABLE');
UPDATE SO_HOLD_SOURCES a
set (hold_entity_id) = (select distinct m.customer_site_id
from ra_customer_merges m
where a.hold_entity_id =
m.duplicate_site_id
and m.request_id = req_id
and m.process_flag = 'N'
and m.set_number = set_num),
last_update_date = sysdate,
last_updated_by = arp_standard.profile.user_id,
last_update_login = arp_standard.profile.last_update_login
where hold_entity_id in (select m.duplicate_site_id
from ra_customer_merges m
where m.process_flag = 'N'
and m.request_id = req_id
and m.set_number = set_num)
and hold_entity_code = 'S';
arp_message.set_name( 'AR', 'AR_ROWS_UPDATED' );
/* customer level update */
arp_message.set_name( 'AR', 'AR_UPDATING_TABLE');
UPDATE SO_HOLD_SOURCES a
set hold_entity_id = (select distinct m.customer_id
from ra_customer_merges m
where a.hold_entity_id =
m.duplicate_id
and m.process_flag = 'N'
and m.request_id = req_id
and m.set_number = set_num),
last_update_date = sysdate,
last_updated_by = arp_standard.profile.user_id,
last_update_login = arp_standard.profile.last_update_login
where hold_entity_id in (select m.duplicate_id
from ra_customer_merges m
where m.process_flag = 'N'
and m.request_id = req_id
and m.set_number = set_num)
and hold_entity_code = 'C';
arp_message.set_name( 'AR', 'AR_ROWS_UPDATED' );