The following lines contain the word 'select', 'insert', 'update' or 'delete':
select
ref_template_id,
base_template_id,
parent_template_id,
reference_type_cd,
object_version_number
from pqh_ref_templates
where ref_template_id = p_ref_template_id;
select ref_template_id,
base_template_id,
parent_template_id,
reference_type_cd,
object_version_number
from pqh_ref_templates
where ref_template_id = p_ref_template_id
for update nowait;
procedure create_update_copied_attribute
(
p_copied_attributes in pqh_prvcalc.t_attid_priv,
p_template_id in number,
p_owner in varchar2 default null) is
--
Cursor csr_tem_attr(p_attribute_id in number) is
Select template_attribute_id,object_version_number
From pqh_template_attributes
Where template_id = p_template_id
and attribute_id = p_attribute_id
FOR UPDATE ;
cursor c_select_flag(p_attribute_id number, p_template_id number) is
select 'x'
from pqh_attributes att, pqh_txn_category_attributes tct, pqh_templates tem
where
att.attribute_id = p_attribute_id
and att.attribute_id = tct.attribute_id
and tem.template_id = p_template_id
and tct.transaction_category_id = tem.transaction_category_id
and nvl(tct.select_flag,'N')='Y';
l_proc varchar2(72) := g_package||'create_update_copied_attribute';
l_last_updated_by pqh_template_attributes.last_updated_by%TYPE;
l_last_update_date pqh_template_attributes.last_update_date%TYPE;
l_last_update_login pqh_template_attributes.last_update_login%TYPE;
l_last_updated_by := -1;
l_last_updated_by := 0;
l_last_updated_by := fnd_load_util.owner_id(p_owner);
l_created_by := l_last_updated_by;
l_last_update_date := sysdate;
l_last_update_login := 0;
open c_select_flag(p_copied_attributes(cnt).attribute_id, p_template_id);
fetch c_select_flag into l_dummy;
if c_select_flag%found then
--
If p_copied_attributes(cnt).mode_flag = 'E' then
l_view_flag := 'Y';
update pqh_template_attributes
set
required_flag = p_copied_attributes(cnt).reqd_flag
,view_flag = l_view_flag
,edit_flag = l_edit_flag
,last_update_date = l_last_update_date
,last_updated_by = l_last_updated_by
,last_update_login = l_last_update_login
where template_attribute_id = l_template_attribute_id;
insert into pqh_template_attributes
(
required_flag
,view_flag
,edit_flag
,template_attribute_id
,attribute_id
,template_id
,object_version_number
,LAST_UPDATE_DATE, LAST_UPDATED_BY,
LAST_UPDATE_LOGIN, CREATED_BY, CREATION_DATE
)
values
(
p_copied_attributes(cnt).reqd_flag
,l_view_flag
,l_edit_flag
,pqh_template_attributes_s.nextval
,p_copied_attributes(cnt).attribute_id
,p_template_id
,1
,L_LAST_UPDATE_DATE, L_LAST_UPDATED_BY,
L_LAST_UPDATE_LOGIN, L_CREATED_BY, L_CREATION_DATE);
close c_select_flag;
end create_update_copied_attribute;
pqh_prvcalc.task_result_update(p_parent_template_id,
'T',
copied_attr_tab);
pqh_prvcalc.task_result_update(p_base_template_id,
'T',
copied_attr_tab);
create_update_copied_attribute
(p_copied_attributes => copied_attr_tab
,p_template_id => p_parent_template_id
,p_owner => p_owner);
,p_last_update_date in varchar2
) is
l_dummy varchar2(10);
l_last_updated_by pqh_templates.last_updated_by%TYPE;
l_last_update_date pqh_templates.last_update_date%TYPE;
l_last_update_login pqh_templates.last_update_login%TYPE;
select template_id
from pqh_templates_vl
where short_name = p_template_short_name;
select 'x'
from pqh_ref_templates
where parent_template_id = p_parent_template_id
and base_template_id = p_base_template_id;
l_last_updated_by := -1;
l_last_updated_by := 0;
l_last_updated_by := fnd_load_util.owner_id(p_owner);
l_creation_date := nvl(to_date(p_last_update_date,'YYYY/MM/DD'),trunc(sysdate));
l_last_update_date := nvl(to_date(p_last_update_date,'YYYY/MM/DD'),trunc(sysdate));
l_last_update_date := sysdate;
l_last_update_login := 0;
update PQH_REF_TEMPLATES
set reference_type_cd = p_reference_type_cd,
last_update_date = l_last_update_date,
last_updated_by = l_last_updated_by,
last_update_login = l_last_update_login
where parent_template_id = l_parent_template_id
and base_template_id = l_base_template_id;
insert into pqh_ref_templates
(REF_TEMPLATE_ID, BASE_TEMPLATE_ID, PARENT_TEMPLATE_ID,
OBJECT_VERSION_NUMBER, LAST_UPDATE_DATE, LAST_UPDATED_BY,
LAST_UPDATE_LOGIN, CREATED_BY, CREATION_DATE,
REFERENCE_TYPE_CD )
values
(PQH_REF_TEMPLATES_S.NEXTVAL, L_BASE_TEMPLATE_ID, L_PARENT_TEMPLATE_ID,
L_OBJECT_VERSION_NUMBER, L_LAST_UPDATE_DATE, L_LAST_UPDATED_BY,
L_LAST_UPDATE_LOGIN, L_CREATED_BY, L_CREATION_DATE,
P_REFERENCE_TYPE_CD );