The following lines contain the word 'select', 'insert', 'update' or 'delete':
select
regn_id,
effective_start_date,
effective_end_date,
name,
organization_id,
business_group_id,
sttry_citn_name,
reg_attribute_category,
reg_attribute1,
reg_attribute2,
reg_attribute3,
reg_attribute4,
reg_attribute5,
reg_attribute6,
reg_attribute7,
reg_attribute8,
reg_attribute9,
reg_attribute10,
reg_attribute11,
reg_attribute12,
reg_attribute13,
reg_attribute14,
reg_attribute15,
reg_attribute16,
reg_attribute17,
reg_attribute18,
reg_attribute19,
reg_attribute20,
reg_attribute21,
reg_attribute22,
reg_attribute23,
reg_attribute24,
reg_attribute25,
reg_attribute26,
reg_attribute27,
reg_attribute28,
reg_attribute29,
reg_attribute30,
object_version_number
from ben_regn_f
where regn_id = p_regn_id
and p_effective_date
between effective_start_date and effective_end_date;
p_delete out nocopy boolean,
p_future_change out nocopy boolean,
p_delete_next_change out nocopy boolean) is
--
l_proc varchar2(72) := g_package||'find_dt_del_modes';
p_delete => p_delete,
p_future_change => p_future_change,
p_delete_next_change => p_delete_next_change);
p_update out nocopy boolean,
p_update_override out nocopy boolean,
p_update_change_insert out nocopy boolean) is
--
l_proc varchar2(72) := g_package||'find_dt_upd_modes';
p_update => p_update,
p_update_override => p_update_override,
p_update_change_insert => p_update_change_insert);
update ben_regn_f t
set t.effective_end_date = p_new_effective_end_date,
t.object_version_number = l_object_version_number
where t.regn_id = p_base_key_value
and p_effective_date
between t.effective_start_date and t.effective_end_date;
update ben_regn_f_tl t
set t.effective_end_date = p_new_effective_end_date,
t.last_update_date = sysdate,
t.last_updated_by = fnd_global.user_id,
t.last_update_login = fnd_global.login_id
where t.regn_id = p_base_key_value
and p_effective_date
between t.effective_start_date and t.effective_end_date;
select
regn_id,
effective_start_date,
effective_end_date,
name,
organization_id,
business_group_id,
sttry_citn_name,
reg_attribute_category,
reg_attribute1,
reg_attribute2,
reg_attribute3,
reg_attribute4,
reg_attribute5,
reg_attribute6,
reg_attribute7,
reg_attribute8,
reg_attribute9,
reg_attribute10,
reg_attribute11,
reg_attribute12,
reg_attribute13,
reg_attribute14,
reg_attribute15,
reg_attribute16,
reg_attribute17,
reg_attribute18,
reg_attribute19,
reg_attribute20,
reg_attribute21,
reg_attribute22,
reg_attribute23,
reg_attribute24,
reg_attribute25,
reg_attribute26,
reg_attribute27,
reg_attribute28,
reg_attribute29,
reg_attribute30,
object_version_number
from ben_regn_f
where regn_id = p_regn_id
and p_effective_date
between effective_start_date and effective_end_date
for update nowait;
If (p_datetrack_mode <> 'INSERT') then
--
-- We must select and lock the current row.
--
Open C_Sel1;
delete from ben_regn_f_tl t
where not exists
(select null
from ben_regn_f_tl b
where b.regn_id = t.regn_id
and b.effective_start_date = t.effective_start_date
);
update ben_regn_f_tl t set (
name,
sttry_citn_name
) = (select
b.name,
b.sttry_citn_name
from ben_regn_f_tl b
where b.regn_id = t.regn_id
and b.effective_start_date = t.effective_start_date
and b.language = t.source_lang)
where (
t.regn_id,
t.effective_start_date,
t.language
) in (select
subt.regn_id,
subt.effective_start_date,
subt.language
from ben_regn_f_tl subb, ben_regn_f_tl subt
where subb.regn_id = subt.regn_id
and subb.effective_start_date = subt.effective_start_date
and subb.language = subt.source_lang
and (subb.name <> subt.name
or subb.sttry_citn_name <> subt.sttry_citn_name
));
insert into ben_regn_f_tl (
regn_id,
effective_start_date,
effective_end_date,
name,
sttry_citn_name,
language,
source_lang,
last_update_date,
last_updated_by,
last_update_login,
created_by,
creation_date
) select
b.regn_id,
b.effective_start_date,
b.effective_end_date,
b.name,
b.sttry_citn_name,
l.language_code,
b.source_lang,
b.last_update_date,
b.last_updated_by,
b.last_update_login,
b.created_by,
b.creation_date
from ben_regn_f_tl b, fnd_languages l
where l.installed_flag in ('I', 'B')
and b.language = userenv('LANG')
and not exists
(select null
from ben_regn_f_tl t
where t.regn_id = b.regn_id
and t.effective_start_date = b.effective_start_date
and t.language = l.language_code);