The following lines contain the word 'select', 'insert', 'update' or 'delete':
select pl_id from ben_pl_f
where short_code = p_short_code
and p_effective_date between effective_start_date and effective_end_date
and business_group_id = p_business_group_id;
l_last_updated_by ben_pl_f.last_updated_by%TYPE;
l_last_update_date ben_pl_f.last_update_date%TYPE;
l_last_update_login ben_pl_f.last_update_login%TYPE;
select pl_id,object_version_number from ben_pl_f
where short_code = p_pl_short_code
and l_effective_date between effective_start_date and effective_end_date
and business_group_id = l_business_group_id;
select pl_typ_id
From ben_pl_typ_f
Where opt_typ_cd = 'RBC'
and l_effective_date between effective_start_date and effective_end_date
and business_group_id = l_business_group_id;
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_last_update_login := 0;
l_dt_mode := pqh_gsp_stage_to_ben.get_update_mode('BEN_PL_F','PL_ID', l_pl_id, l_effective_date) ;
BEN_PLAN_API.UPDATE_PLAN(
P_EFFECTIVE_DATE => l_effective_date
,P_BUSINESS_GROUP_ID => l_business_group_id
,P_NAME => p_name
,P_PL_ID => l_pl_id
,P_PL_STAT_CD => p_pl_stat_cd
,P_PL_CD => p_pl_cd
,P_RT_STRT_DT_RL => ''
,P_VRFY_FMLY_MMBR_RL => ''
,P_SHORT_CODE => p_pl_short_code
,P_SHORT_NAME => p_short_name
,P_EFFECTIVE_START_DATE => l_effective_start_date
,P_EFFECTIVE_END_DATE => l_effective_end_date
,P_OBJECT_VERSION_NUMBER => l_ovn
,P_DATETRACK_MODE => l_dt_mode
);
l_last_updated_by pqh_rate_matrix_nodes.last_updated_by%TYPE;
l_last_update_date pqh_rate_matrix_nodes.last_update_date%TYPE;
l_last_update_login pqh_rate_matrix_nodes.last_update_login%TYPE;
select rate_matrix_node_id
from pqh_rate_matrix_nodes
Where short_code = p_code
and business_group_id = l_business_group_id;
select pl_id from ben_pl_f
where short_code = p_pl_short_code
and l_effective_date between effective_start_date and effective_end_date
and business_group_id = l_business_group_id;
select eligy_prfl_id from ben_eligy_prfl_f
where name = p_eligy_prfl_name
and l_effective_date between effective_start_date and effective_end_date
and business_group_id = l_business_group_id;
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_last_update_login := 0;
Update pqh_rate_matrix_nodes
set
RATE_MATRIX_NODE_ID = l_rate_matrix_node_id,
SHORT_CODE = p_node_short_code,
PL_ID = l_pl_id,
LEVEL_NUMBER = p_level_number,
CRITERIA_SHORT_CODE = p_criteria_short_code,
NODE_NAME = p_node_name,
PARENT_NODE_ID = l_parent_node_id,
ELIGY_PRFL_ID = l_eligy_prfl_id,
BUSINESS_GROUP_ID = l_business_group_id,
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 rate_matrix_node_id = l_rate_matrix_node_id;
Insert into pqh_rate_matrix_nodes
(
RATE_MATRIX_NODE_ID,
SHORT_CODE,
PL_ID,
LEVEL_NUMBER,
CRITERIA_SHORT_CODE,
NODE_NAME,
PARENT_NODE_ID,
ELIGY_PRFL_ID,
BUSINESS_GROUP_ID,
LEGISLATION_CODE,
CREATED_BY,
CREATION_DATE,
LAST_UPDATED_BY,
LAST_UPDATE_DATE,
LAST_UPDATE_LOGIN,
OBJECT_VERSION_NUMBER
)
Values
(
pqh_rate_matrix_nodes_s.nextval,
p_node_short_code,
l_pl_id,
p_level_number,
p_criteria_short_code,
p_node_name,
l_parent_node_id,
l_eligy_prfl_id,
l_business_group_id,
p_legislation_code,
l_created_by,
l_creation_date,
l_last_updated_by,
l_last_update_date,
l_last_update_login,
l_ovn
);
l_last_updated_by pqh_rt_matrix_node_values.last_updated_by%TYPE;
l_last_update_date pqh_rt_matrix_node_values.last_update_date%TYPE;
l_last_update_login pqh_rt_matrix_node_values.last_update_login%TYPE;
select rate_matrix_node_id
from pqh_rate_matrix_nodes
Where short_code = p_code
and business_group_id = l_business_group_id;
select node_value_id
from pqh_rt_matrix_node_values
Where short_code = p_short_code
and business_group_id = l_business_group_id;
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_last_update_login := 0;
Update pqh_rt_matrix_node_values
set
RATE_MATRIX_NODE_ID = l_rate_matrix_node_id,
SHORT_CODE = p_short_code,
CHAR_VALUE1 = p_char_value1,
CHAR_VALUE2 = p_char_value2,
CHAR_VALUE3 = p_char_value3,
CHAR_VALUE4 = p_char_value4,
NUMBER_VALUE1 = p_number_value1,
NUMBER_VALUE2 = p_number_value2,
NUMBER_VALUE3 = p_number_value3,
NUMBER_VALUE4 = p_number_value4,
DATE_VALUE1 = to_date(p_date_value1,'DD/MM/YYYY'),
DATE_VALUE2 = to_date(p_date_value2,'DD/MM/YYYY'),
DATE_VALUE3 = to_date(p_date_value3,'DD/MM/YYYY'),
DATE_VALUE4 = to_date(p_date_value4,'DD/MM/YYYY'),
BUSINESS_GROUP_ID = l_business_group_id,
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 node_value_id = l_node_value_id;
Insert into pqh_rt_matrix_node_values
(
NODE_VALUE_ID ,
RATE_MATRIX_NODE_ID ,
SHORT_CODE ,
CHAR_VALUE1 ,
CHAR_VALUE2 ,
CHAR_VALUE3 ,
CHAR_VALUE4 ,
NUMBER_VALUE1 ,
NUMBER_VALUE2 ,
NUMBER_VALUE3 ,
NUMBER_VALUE4 ,
DATE_VALUE1 ,
DATE_VALUE2 ,
DATE_VALUE3 ,
DATE_VALUE4 ,
BUSINESS_GROUP_ID ,
LEGISLATION_CODE ,
CREATED_BY ,
CREATION_DATE ,
LAST_UPDATED_BY ,
LAST_UPDATE_DATE ,
LAST_UPDATE_LOGIN ,
OBJECT_VERSION_NUMBER
)
Values
(
pqh_rt_matrix_node_values_s.nextval,
l_rate_matrix_node_id,
p_short_code,
p_char_value1,
p_char_value2,
p_char_value3,
p_char_value4,
p_number_value1,
p_number_value2,
p_number_value3,
p_number_value4,
to_date(p_date_value1,'DD/MM/YYYY'),
to_date(p_date_value2,'DD/MM/YYYY'),
to_date(p_date_value3,'DD/MM/YYYY'),
to_date(p_date_value4,'DD/MM/YYYY'),
l_business_group_id,
p_legislation_code,
l_created_by,
l_creation_date,
l_last_updated_by,
l_last_update_date,
l_last_update_login,
l_ovn
);
l_last_updated_by ben_pl_f.last_updated_by%TYPE;
l_last_update_date ben_pl_f.last_update_date%TYPE;
l_last_update_login ben_pl_f.last_update_login%TYPE;
Select rate_matrix_node_id, pl_id from pqh_rate_matrix_nodes
Where short_code = p_node_short_code
and business_group_id = l_business_group_id;
select short_code
From ben_pl_f
Where pl_id = l_pl_id
and l_effective_date between effective_start_date and effective_end_date
and business_group_id = l_business_group_id;
Select criteria_rate_defn_id,short_name
From pqh_criteria_rate_defn_vl
Where short_name = p_crit_rt_defn_short_code
and business_group_id = l_business_group_id;
select acty_base_rt_id
From ben_acty_base_rt_f
Where acty_typ_cd = 'RBC'
and l_effective_date between effective_start_date and effective_end_date
and business_group_id = l_business_group_id
and pl_id = l_pl_id
and mapping_table_name = 'PQH_CRITERIA_RATE_DEFN'
and mapping_table_pk_id = l_crd_id;
Select rate_matrix_rate_id ,object_version_number
From pqh_rate_matrix_rates_f
Where criteria_rate_defn_id = l_crd_id
and rate_matrix_node_id = l_rate_matrix_node_id
and l_effective_date between effective_start_date and effective_end_date
and business_group_id = l_business_group_id;
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_last_update_login := 0;
Insert into pqh_rate_matrix_rates_f
(RATE_MATRIX_RATE_ID,
EFFECTIVE_START_DATE,
EFFECTIVE_END_DATE,
RATE_MATRIX_NODE_ID,
CRITERIA_RATE_DEFN_ID,
MIN_RATE_VALUE,
MAX_RATE_VALUE,
MID_RATE_VALUE,
RATE_VALUE,
BUSINESS_GROUP_ID,
LEGISLATION_CODE,
CREATED_BY ,
CREATION_DATE ,
LAST_UPDATED_BY ,
LAST_UPDATE_DATE ,
LAST_UPDATE_LOGIN ,
OBJECT_VERSION_NUMBER
)
Values
(pqh_rate_matrix_rates_s.nextval,
l_effective_date,
to_date('31/12/4712','dd/mm/yyyy'),
l_rate_matrix_node_id,
l_crd_id,
p_min_rate_value,
p_max_rate_value,
p_mid_rate_value,
p_rate_value,
l_business_group_id,
p_legislation_code,
l_created_by,
l_creation_date,
l_last_updated_by,
l_last_update_date,
l_last_update_login,
l_ovn);
l_dt_mode := pqh_gsp_stage_to_ben.get_update_mode('PQH_RATE_MATRIX_RATES_F','RATE_MATRIX_RATE_ID', l_rt_matrix_rate_id, l_effective_date) ;
PQH_RATE_MATRIX_RATES_API.update_rate_matrix_rate(
p_effective_date => l_effective_date
,p_business_group_id => l_business_group_id
,p_rate_matrix_rate_id => l_rt_matrix_rate_id
,p_EFFECTIVE_START_DATE => l_effective_start_date
,p_EFFECTIVE_END_DATE => l_effective_end_date
,p_RATE_MATRIX_NODE_ID => l_rate_matrix_node_id
,p_CRITERIA_RATE_DEFN_ID => l_crd_id
,p_MIN_RATE_VALUE => p_min_rate_value
,p_MAX_RATE_VALUE => p_max_rate_value
,p_MID_RATE_VALUE => p_mid_rate_value
,p_RATE_VALUE => p_rate_value
,p_datetrack_mode => l_dt_mode
,p_object_version_number => l_ovn
);
l_last_updated_by pqh_criteria_rate_defn.last_updated_by%TYPE;
l_last_update_date pqh_criteria_rate_defn.last_update_date%TYPE;
l_last_update_login pqh_criteria_rate_defn.last_update_login%TYPE;
Cursor c1 is select userenv('LANG') from dual ;
select criteria_rate_defn_id from pqh_criteria_rate_defn
where short_name = p_short_name
and business_group_id = l_business_group_id;
Select pqh_criteria_rate_defn_s.nextval
From 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_last_update_login := 0;
Update pqh_criteria_rate_defn
set
short_name = p_short_name
,uom = p_uom
,currency_code = p_currency_code
,reference_period_cd = p_reference_period_cd
,define_max_rate_flag = p_define_max_rate_flag
,define_min_rate_flag = p_define_min_rate_flag
,define_mid_rate_flag = p_define_mid_rate_flag
,define_std_rate_flag = p_define_std_rate_flag
,rate_calc_cd = p_rate_calc_cd
--,rate_calc_rule = p_rate_calc_rule
,preferential_rate_cd = p_preferential_rate_cd
--,preferential_rate_rule = p_preferential_rate_rule
,rounding_cd = p_rounding_cd
--,rounding_rule = p_rounding_rule
,business_group_id = l_business_group_id
,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 criteria_rate_defn_id = l_criteria_rate_defn_id;
UPDATE pqh_criteria_rate_defn_tl
SET name = p_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 criteria_rate_defn_id = l_criteria_rate_defn_id
AND userenv('LANG') in (LANGUAGE, SOURCE_LANG);
insert into pqh_criteria_rate_defn_tl
( criteria_rate_defn_id,
name,
language,
source_lang,
created_by,
creation_date,
last_updated_by,
last_update_date ,
last_update_login
)
Select
l_criteria_rate_defn_id,
p_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_criteria_rate_defn_tl crl
where crl.criteria_rate_defn_id = l_criteria_rate_defn_id
and crl.language = l.language_code );
Insert into pqh_criteria_rate_defn
(criteria_rate_defn_id
,short_name
,uom
,currency_code
,reference_period_cd
,define_max_rate_flag
,define_min_rate_flag
,define_mid_rate_flag
,define_std_rate_flag
,rate_calc_cd
-- ,rate_calc_rule
,preferential_rate_cd
-- ,preferential_rate_rule
,rounding_cd
-- ,rounding_rule
,business_group_id
,legislation_code
,created_by
,creation_date
,last_updated_by
,last_update_date
,last_update_login
,object_version_number
)
Values
(l_criteria_rate_defn_id
,p_short_name
,p_uom
,p_currency_code
,p_reference_period_cd
,p_define_max_rate_flag
,p_define_min_rate_flag
,p_define_mid_rate_flag
,p_define_std_rate_flag
,p_rate_calc_cd
-- ,p_rate_calc_rule
,p_preferential_rate_cd
-- ,p_preferential_rate_rule
,p_rounding_cd
-- ,p_rounding_rule
,l_business_group_id
,p_legislation_code
,l_created_by
,l_creation_date
,l_last_updated_by
,l_last_update_date
,l_last_update_login
,l_ovn
);
insert into pqh_criteria_rate_defn_tl
( criteria_rate_defn_id,
name,
language,
source_lang,
created_by,
creation_date,
last_updated_by,
last_update_date ,
last_update_login
)
Select
l_criteria_rate_defn_id,
p_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_criteria_rate_defn_tl crl
where crl.criteria_rate_defn_id = l_criteria_rate_defn_id
and crl.language = l.language_code );
l_last_updated_by pqh_criteria_rate_factors.last_updated_by%TYPE;
l_last_update_date pqh_criteria_rate_factors.last_update_date%TYPE;
l_last_update_login pqh_criteria_rate_factors.last_update_login%TYPE;
Cursor c1 is select userenv('LANG') from dual ;
select criteria_rate_defn_id from pqh_criteria_rate_defn
where short_name = p_crit_rt_defn_short_name
and business_group_id = l_business_group_id;
select criteria_rate_defn_id from pqh_criteria_rate_defn
where short_name = p_parent_crit_rt_def_name
and business_group_id = l_business_group_id;
select criteria_rate_factor_id from pqh_criteria_rate_factors
where criteria_rate_defn_id = crd_id
and parent_criteria_rate_defn_id = crdp_id
and business_group_id = l_business_group_id;
Select pqh_criteria_rate_factors_s.nextval
From dual;
select pl_id from ben_pl_f
where short_code = p_parent_rate_matrix_code
and l_effective_date between effective_start_date and effective_end_date
and business_group_id = l_business_group_id;
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_last_update_login := 0;
update pqh_criteria_rate_factors
set
criteria_rate_defn_id = l_criteria_rate_defn_id
,parent_rate_matrix_id = l_parent_rate_matrix_id
,parent_criteria_rate_defn_id = l_parent_criteria_rate_defn_id
,business_group_id = l_business_group_id
,legislation_code = p_legislation_code
where criteria_rate_factor_id = l_criteria_rate_factor_id;
insert into pqh_criteria_rate_factors
(criteria_rate_factor_id
,criteria_rate_defn_id
,parent_rate_matrix_id
,parent_criteria_rate_defn_id
,business_group_id
,legislation_code
,object_version_number
)
Values
(l_criteria_rate_factor_id
,l_criteria_rate_defn_id
,l_parent_rate_matrix_id
,l_parent_criteria_rate_defn_id
,l_business_group_id
,p_legislation_code
,l_object_version_number
);
l_last_updated_by pqh_rate_factor_on_elmnts.last_updated_by%TYPE;
l_last_update_date pqh_rate_factor_on_elmnts.last_update_date%TYPE;
l_last_update_login pqh_rate_factor_on_elmnts.last_update_login%TYPE;
Cursor c1 is select userenv('LANG') from dual ;
select criteria_rate_defn_id from pqh_criteria_rate_defn
where short_name = p_crit_rt_defn_short_name
and business_group_id = l_business_group_id;
select criteria_rate_defn_id from pqh_criteria_rate_defn
where short_name = p_parent_crit_rt_def_name
and business_group_id = l_business_group_id;
select criteria_rate_factor_id from pqh_criteria_rate_factors
where criteria_rate_defn_id = crd_id
and parent_criteria_rate_defn_id = crdp_id
and business_group_id = l_business_group_id;
select element_type_id from pay_element_types_f
where element_name = p_element_type_name
and l_effective_date between effective_start_date and effective_end_date
and (business_group_id = l_business_group_id OR (legislation_code in
(select legislation_code from per_business_groups_perf where business_group_id = l_business_group_id)
and business_group_id is null));
select criteria_rate_element_id from pqh_criteria_rate_elements
where criteria_rate_defn_id = crd_id
and element_type_id = ele_id
and business_group_id = l_business_group_id;
select rate_factor_on_elmnt_id from pqh_rate_factor_on_elmnts
where criteria_rate_factor_id = crf_id
and criteria_rate_element_id = cre_id
and business_group_id = l_business_group_id;
select input_value_id from pay_input_values_f
where name = p_rate_factor_val_record_col
and element_type_id = l_element_type_id
and l_effective_date between effective_start_date and effective_end_date
and business_group_id = l_business_group_id;
select name from pay_input_values_f
where name = p_rate_factor_val_record_col
and element_type_id = l_element_type_id
and l_effective_date between effective_start_date and effective_end_date;
Select pqh_rate_factor_on_elmnts_s.nextval
From 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_last_update_login := 0;
update pqh_rate_factor_on_elmnts
set
rate_factor_on_elmnt_id =l_rate_factor_on_elmnt_id
,criteria_rate_element_id =l_criteria_rate_element_id
,criteria_rate_factor_id =l_criteria_rate_factor_id
,rate_factor_val_record_tbl =p_rate_factor_val_record_tbl
,rate_factor_val_record_col =l_rate_factor_val_record_col
,business_group_id =l_business_group_id
,legislation_code =p_legislation_code
where rate_factor_on_elmnt_id =l_rate_factor_on_elmnt_id;
insert into pqh_rate_factor_on_elmnts
(rate_factor_on_elmnt_id
,criteria_rate_element_id
,criteria_rate_factor_id
,rate_factor_val_record_tbl
,rate_factor_val_record_col
,business_group_id
,legislation_code
,object_version_number
)
Values
(l_rate_factor_on_elmnt_id
,l_criteria_rate_element_id
,l_criteria_rate_factor_id
,p_rate_factor_val_record_tbl
,l_rate_factor_val_record_col
,l_business_group_id
,p_legislation_code
,l_object_version_number
);
l_last_updated_by pqh_criteria_rate_elements.last_updated_by%TYPE;
l_last_update_date pqh_criteria_rate_elements.last_update_date%TYPE;
l_last_update_login pqh_criteria_rate_elements.last_update_login%TYPE;
select criteria_rate_defn_id from pqh_criteria_rate_defn
where short_name = p_crit_rt_defn_short_name
and business_group_id = l_business_group_id;
select element_type_id from pay_element_types_f
where element_name = p_element_type_name
and l_effective_date between effective_start_date and effective_end_date
and (business_group_id = l_business_group_id OR (legislation_code in
(select legislation_code from per_business_groups_perf where business_group_id = l_business_group_id)
and business_group_id is null));
select input_value_id from pay_input_values_f
where name = p_input_value_name
and element_type_id = l_element_type_id
and l_effective_date between effective_start_date and effective_end_date
and (business_group_id = l_business_group_id OR (legislation_code in
(select legislation_code from per_business_groups_perf where business_group_id = l_business_group_id)
and business_group_id is null));
select criteria_rate_element_id from pqh_criteria_rate_elements
where criteria_rate_defn_id = crd_id
and element_type_id = ele_id
and input_value_id = inp_id
and business_group_id = l_business_group_id;
Select pqh_criteria_rate_elements_s.nextval
From dual;
Cursor c1 is select userenv('LANG') from 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_last_update_login := 0;
update pqh_criteria_rate_elements
set
criteria_rate_element_id = l_criteria_rate_element_id
,criteria_rate_defn_id = l_criteria_rate_defn_id
,element_type_id = l_element_type_id
,input_value_id = l_input_value_id
,business_group_id = l_business_group_id
,legislation_code = p_legislation_code
,object_version_number = l_object_version_number
where criteria_rate_element_id = l_criteria_rate_element_id;
insert into pqh_criteria_rate_elements
(criteria_rate_element_id
,criteria_rate_defn_id
,element_type_id
,input_value_id
,business_group_id
,legislation_code
,object_version_number
)
Values
(l_criteria_rate_element_id
,l_criteria_rate_defn_id
,l_element_type_id
,l_input_value_id
,l_business_group_id
,p_legislation_code
,l_object_version_number
);
l_last_updated_by pqh_rate_element_relations.last_updated_by%TYPE;
l_last_update_date pqh_rate_element_relations.last_update_date%TYPE;
l_last_update_login pqh_rate_element_relations.last_update_login%TYPE;
Cursor c1 is select userenv('LANG') from dual ;
select criteria_rate_defn_id from pqh_criteria_rate_defn
where short_name = p_crit_rt_defn_short_name
and business_group_id = l_business_group_id;
select element_type_id from pay_element_types_f
where element_name = p_element_type_name
and l_effective_date between effective_start_date and effective_end_date
and (business_group_id = l_business_group_id OR (legislation_code in
(select legislation_code from per_business_groups_perf where business_group_id = l_business_group_id)
and business_group_id is null));
select criteria_rate_element_id from pqh_criteria_rate_elements
where criteria_rate_defn_id = crd_id
and element_type_id = ele_id
and business_group_id = l_business_group_id;
select element_type_id from pay_element_types_f
where element_name = p_rel_element_name
and l_effective_date between effective_start_date and effective_end_date
and business_group_id = l_business_group_id;
select input_value_id from pay_input_values_f
where name = p_rel_input_val_name
and element_type_id = l_rel_element_type_id
and l_effective_date between effective_start_date and effective_end_date
and business_group_id = l_business_group_id;
select rate_element_relation_id from pqh_rate_element_relations
where criteria_rate_element_id = cre_id
and relation_type_cd = p_relation_type_code
and rel_element_type_id = rel_ele
and business_group_id = l_business_group_id;
Select pqh_rate_element_relations_s.nextval
From 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_last_update_login := 0;
update pqh_rate_element_relations
set
rate_element_relation_id = l_rate_element_relation_id
,criteria_rate_element_id = l_criteria_rate_element_id
,relation_type_cd = p_relation_type_code
,rel_element_type_id = l_rel_element_type_id
,rel_input_value_id = l_rel_input_value_id
,business_group_id = l_business_group_id
,legislation_code = p_legislation_code
where rate_element_relation_id = l_rate_element_relation_id;
insert into pqh_rate_element_relations
(rate_element_relation_id
,criteria_rate_element_id
,relation_type_cd
,rel_element_type_id
,rel_input_value_id
,business_group_id
,legislation_code
,object_version_number
)
Values
(l_rate_element_relation_id
,l_criteria_rate_element_id
,p_relation_type_code
,l_rel_element_type_id
,l_rel_input_value_id
,l_business_group_id
,p_legislation_code
,l_object_version_number
);
delete from PQH_CRITERIA_RATE_DEFN_TL T
where not exists
(select NULL
from PQH_CRITERIA_RATE_DEFN B
where B.CRITERIA_RATE_DEFN_ID = T.CRITERIA_RATE_DEFN_ID
);
update PQH_CRITERIA_RATE_DEFN_TL T set (
NAME
) = (select
B.NAME
from PQH_CRITERIA_RATE_DEFN_TL B
where B.CRITERIA_RATE_DEFN_ID = T.CRITERIA_RATE_DEFN_ID
and B.LANGUAGE = T.SOURCE_LANG)
where (
T.CRITERIA_RATE_DEFN_ID,
T.LANGUAGE
) in (select
SUBT.CRITERIA_RATE_DEFN_ID,
SUBT.LANGUAGE
from PQH_CRITERIA_RATE_DEFN_TL SUBB, PQH_CRITERIA_RATE_DEFN_TL SUBT
where SUBB.CRITERIA_RATE_DEFN_ID = SUBT.CRITERIA_RATE_DEFN_ID
and SUBB.LANGUAGE = SUBT.SOURCE_LANG
and (SUBB.NAME <> SUBT.NAME
));
insert into PQH_CRITERIA_RATE_DEFN_TL (
CRITERIA_RATE_DEFN_ID,
NAME,
LAST_UPDATE_DATE,
CREATION_DATE,
CREATED_BY,
LAST_UPDATE_LOGIN,
LAST_UPDATED_BY,
LANGUAGE,
SOURCE_LANG
) select
B.CRITERIA_RATE_DEFN_ID,
B.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_CRITERIA_RATE_DEFN_TL B, FND_LANGUAGES L
where L.INSTALLED_FLAG in ('I', 'B')
and B.LANGUAGE = userenv('LANG')
and not exists
(select NULL
from PQH_CRITERIA_RATE_DEFN_TL T
where T.CRITERIA_RATE_DEFN_ID = B.CRITERIA_RATE_DEFN_ID
and T.LANGUAGE = L.LANGUAGE_CODE);