The following lines contain the word 'select', 'insert', 'update' or 'delete':
select
template_name,
short_name,
template_id,
attribute_only_flag,
enable_flag,
create_flag,
transaction_category_id,
under_review_flag,
object_version_number,
freeze_status_cd,
template_type_cd,
legislation_code
from pqh_templates
where template_id = p_template_id;
select template_name,
short_name,
template_id,
attribute_only_flag,
enable_flag,
create_flag,
transaction_category_id,
under_review_flag,
object_version_number,
freeze_status_cd,
template_type_cd,
legislation_code
from pqh_templates
where template_id = p_template_id
for update nowait;
,p_last_update_date in varchar2
) is
--
--
l_data_migrator_mode varchar2(1);
,p_last_update_date => p_last_update_date);
,p_last_update_date in varchar2
) is
--
l_effective_date date := sysdate ;
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;
cursor c1 is select userenv('LANG') from dual ;
Cursor c2 is select transaction_category_id
from pqh_transaction_categories
where short_name = p_tran_cat_short_name
and business_group_id is null;
Cursor c3 is select template_id
from pqh_templates
where short_name = p_short_name ;
Cursor C_Sel1 is select pqh_templates_s.nextval from sys.dual;
l_last_updated_by := -1;
l_last_updated_by := 0;
l_last_updated_by := fnd_load_util.owner_id(p_owner);
l_last_update_date := sysdate;
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_login := 0;
update pqh_templates
set
template_name = p_template_name,
short_name = p_short_name,
attribute_only_flag = p_attribute_only_flag,
enable_flag = p_enable_flag,
create_flag = p_create_flag,
transaction_category_id = l_transaction_category_id,
under_review_flag = p_under_review_flag,
freeze_status_cd = p_freeze_status_cd,
template_type_cd = p_template_type_cd,
legislation_code = p_legislation_code,
last_updated_by = l_last_updated_by,
last_update_date = l_last_update_date,
last_update_login = l_last_update_login
where template_id = l_template_id;
UPDATE pqh_templates_tl
SET template_name = p_template_name,
last_updated_by = l_last_updated_by,
last_update_date = l_last_update_date,
last_update_login = l_last_update_login,
source_lang = userenv('LANG')
WHERE template_id = l_template_id
AND userenv('LANG') in (LANGUAGE, SOURCE_LANG);
insert into pqh_templates_tl(
template_id,
template_name,
language,
source_lang,
created_by,
creation_date,
last_updated_by,
last_update_date ,
last_update_login
)
Select
l_template_id,
p_template_name,
l.language_code,
l_language ,
l_created_by,
l_creation_date,
l_last_updated_by,
l_last_update_date,
l_last_update_login
from fnd_languages l
where l.installed_flag in ('I','B')
and not exists (select null
from pqh_templates_tl ttl
where ttl.template_id = l_template_id
and ttl.language = l.language_code );
insert into pqh_templates(
template_name,
template_id,
attribute_only_flag,
enable_flag,
create_flag,
transaction_category_id,
under_review_flag,
object_version_number,
last_update_date,
last_updated_by,
last_update_login,
created_by,
creation_date,
freeze_status_cd,
template_type_cd,
legislation_code,
short_name
)
Values(
p_template_name,
l_template_id,
p_attribute_only_flag,
p_enable_flag,
p_create_flag,
l_transaction_category_id,
p_under_review_flag,
1,
l_last_update_date,
l_last_updated_by,
l_last_update_login,
l_created_by,
l_creation_date,
p_freeze_status_cd,
p_template_type_cd,
p_legislation_code,
p_short_name
);
insert into pqh_templates_tl(
template_id,
template_name,
language,
source_lang,
created_by,
creation_date,
last_updated_by,
last_update_date ,
last_update_login
)
Select
l_template_id,
p_template_name,
l.language_code,
l_language ,
l_created_by,
l_creation_date,
l_last_updated_by,
l_last_update_date,
l_last_update_login
from fnd_languages l
where l.installed_flag in ('I','B')
and not exists (select null
from pqh_templates_tl ttl
where ttl.template_id = l_template_id
and ttl.language = l.language_code );
delete from PQH_TEMPLATES_TL T
where not exists
(select NULL
from PQH_TEMPLATES B
where B.TEMPLATE_ID = T.TEMPLATE_ID
);
update PQH_TEMPLATES_TL T set (
TEMPLATE_NAME
) = (select
B.TEMPLATE_NAME
from PQH_TEMPLATES_TL B
where B.TEMPLATE_ID = T.TEMPLATE_ID
and B.LANGUAGE = T.SOURCE_LANG)
where (
T.TEMPLATE_ID,
T.LANGUAGE
) in (select
SUBT.TEMPLATE_ID,
SUBT.LANGUAGE
from PQH_TEMPLATES_TL SUBB, PQH_TEMPLATES_TL SUBT
where SUBB.TEMPLATE_ID = SUBT.TEMPLATE_ID
and SUBB.LANGUAGE = SUBT.SOURCE_LANG
and (SUBB.TEMPLATE_NAME <> SUBT.TEMPLATE_NAME
));
insert into PQH_TEMPLATES_TL (
TEMPLATE_ID,
TEMPLATE_NAME,
LAST_UPDATE_DATE,
CREATION_DATE,
CREATED_BY,
LAST_UPDATE_LOGIN,
LAST_UPDATED_BY,
LANGUAGE,
SOURCE_LANG
) select
B.TEMPLATE_ID,
B.TEMPLATE_NAME,
B.LAST_UPDATE_DATE,
B.CREATION_DATE,
B.CREATED_BY,
B.LAST_UPDATE_LOGIN,
B.LAST_UPDATED_BY,
L.LANGUAGE_CODE,
B.SOURCE_LANG
from PQH_TEMPLATES_TL B, FND_LANGUAGES L
where L.INSTALLED_FLAG in ('I', 'B')
and B.LANGUAGE = userenv('LANG')
and not exists
(select NULL
from PQH_TEMPLATES_TL T
where T.TEMPLATE_ID = B.TEMPLATE_ID
and T.LANGUAGE = L.LANGUAGE_CODE);