The following lines contain the word 'select', 'insert', 'update' or 'delete':
l_bg_prejoin_sql := ' select Effective_Date,terr.TERRITORY_SHORT_NAME CountryName,Short_Name, '
||' lookup1.meaning app_gen_method_val, '
||' lookup2.meaning emp_gen_method_val,lookup3.meaning cwk_gen_method_val, '
||' curr.name CurrencyName , grade_flex_stru_code,group_flex_stru_code,'
||' job_flex_stru_code,cost_flex_stru_code, '
||' position_flex_stru_code,competence_flex_stru_code from (';
l_temp_sql:= ' SELECT '||
'''' || p_business_grp_tab(i).effective_date ||''''||' effective_date ,'||
'''' || p_business_grp_tab(i).language_code ||''''||' language_code ,'||
'''' || p_business_grp_tab(i).date_from ||''''||' date_from ,'||
'''' || REPLACE(p_business_grp_tab(i).name, '''', '''''') ||''''||' name ,'||
'''' || p_business_grp_tab(i).type ||''''||' type ,'||
'''' || p_business_grp_tab(i).internal_external_flag ||''''||' internal_external_flag ,'||
'''' || REPLACE(p_business_grp_tab(i).short_name, '''', '''''') ||''''||' short_name ,'||
'''' || p_business_grp_tab(i).emp_gen_method ||''''||' emp_gen_method ,'||
'''' || p_business_grp_tab(i).app_gen_method ||''''||' app_gen_method ,'||
'''' || p_business_grp_tab(i).cwk_gen_method ||''''||' cwk_gen_method ,'||
'''' || p_business_grp_tab(i).legislation_code ||''''||' legislation_code ,'||
'''' || p_business_grp_tab(i).currency_code ||''''||' currency_code ,'||
'''' || p_business_grp_tab(i).fiscal_year_start ||''''||' fiscal_year_start ,'||
'''' || p_business_grp_tab(i).min_work_age ||''''||' min_work_age ,'||
'''' || p_business_grp_tab(i).max_work_age ||''''||' max_work_age ,'||
'''' || p_business_grp_tab(i).location_code ||''''||' location_code ,'||
'''' || p_business_grp_tab(i).grade_flex_stru_code ||''''||' grade_flex_stru_code ,'||
'''' || p_business_grp_tab(i).group_flex_stru_code ||''''||' group_flex_stru_code ,'||
'''' || p_business_grp_tab(i).job_flex_stru_code ||''''||' job_flex_stru_code ,'||
'''' || p_business_grp_tab(i).cost_flex_stru_code ||''''||' cost_flex_stru_code ,'||
'''' || p_business_grp_tab(i).position_flex_stru_code ||''''||' position_flex_stru_code ,'||
'''' || p_business_grp_tab(i).security_group_name ||''''||' security_group_name ,'||
'''' || p_business_grp_tab(i).competence_flex_stru_code||''''||' competence_flex_stru_code '||
' FROM DUAL UNION';
l_temp_sql:= ' SELECT '||
'''' || p_org_ent_tab(i).effective_date ||''''||' effective_date ,'||
'''' || p_org_ent_tab(i).date_from ||''''||' date_from ,'||
'''' || REPLACE( p_org_ent_tab(i).business_grp_name, '''', '''''') ||''''||' business_grp_name ,'||
'''' || REPLACE( p_org_ent_tab(i).name , '''', '''''') ||''''||' name ,'||
'''' || p_org_ent_tab(i).location_code ||''''||' location_code ,'||
'''' || p_org_ent_tab(i).internal_external_flag ||''''||' internal_external_flag '||
' FROM DUAL UNION';
l_temp_sql:= ' SELECT '||
'''' || p_org_oc_tab(i).effective_date ||''''||' effective_date ,'||
'''' || p_org_oc_tab(i).date_from ||''''||' date_from ,'||
'''' || REPLACE(p_org_oc_tab(i).business_grp_name , '''', '''''') ||''''||' business_grp_name ,'||
'''' || REPLACE(p_org_oc_tab(i).name , '''', '''''') ||''''||' name ,'||
'''' || p_org_oc_tab(i).location_code ||''''||' location_code ,'||
'''' || p_org_oc_tab(i).internal_external_flag ||''''||' internal_external_flag '||
' FROM DUAL UNION';
l_temp_sql:= ' SELECT '||
'''' || p_org_le_tab(i).effective_date ||''''||' effective_date ,'||
'''' || p_org_le_tab(i).date_from ||''''||' date_from ,'||
'''' || REPLACE(p_org_le_tab(i).business_grp_name , '''', '''''') ||''''||' business_grp_name ,'||
'''' || REPLACE (p_org_le_tab(i).name, '''', '''''') ||''''||' name ,'||
'''' || p_org_le_tab(i).location_code ||''''||' location_code ,'||
'''' || p_org_le_tab(i).internal_external_flag ||''''||' internal_external_flag '||
' FROM DUAL UNION';
select meaning into l_enabled from hr_lookups where lookup_type = 'YES_NO' and lookup_code = 'Y';
l_class_prejoin_sql:= ' select effective_date,'
||' date_from,'
||' business_grp_name,'
||' org_classif_code,'
||' organization_name,'
||' hrlkp.meaning org_classif_val,'
||' ''Yes'' Enabled '
||' from ( ';
l_temp_sql:= ' SELECT '||
'''' || p_org_ent_class_tab(i).effective_date ||''''||' effective_date ,'||
'''' || p_org_ent_class_tab(i).date_from ||''''||' date_from ,'||
'''' || REPLACE(p_org_ent_class_tab(i).business_grp_name, '''', '''''') ||''''||' business_grp_name ,'||
'''' || p_org_ent_class_tab(i).org_classif_code ||''''||' org_classif_code ,'||
'''' || REPLACE(p_org_ent_class_tab(i).organization_name, '''', '''''') ||''''||' organization_name '||
' FROM DUAL UNION';
l_temp_sql:= ' SELECT '||
'''' || p_org_oc_class_tab(i).effective_date ||''''||' effective_date ,'||
'''' || p_org_oc_class_tab(i).date_from ||''''||' date_from ,'||
'''' || REPLACE(p_org_oc_class_tab(i).business_grp_name, '''', '''''') ||''''||' business_grp_name ,'||
'''' || p_org_oc_class_tab(i).org_classif_code ||''''||' org_classif_code ,'||
'''' || REPLACE(p_org_oc_class_tab(i).organization_name, '''', '''''') ||''''||' organization_name '||
' FROM DUAL UNION';
l_temp_sql:= ' SELECT '||
'''' || p_org_le_class_tab(i).effective_date ||''''||' effective_date ,'||
'''' || p_org_le_class_tab(i).date_from ||''''||' date_from ,'||
'''' || REPLACE(p_org_le_class_tab(i).business_grp_name, '''', '''''') ||''''||' business_grp_name ,'||
'''' || p_org_le_class_tab(i).org_classif_code ||''''||' org_classif_code ,'||
'''' || REPLACE (p_org_le_class_tab(i).organization_name, '''', '''''') ||''''||' organization_name '||
' FROM DUAL UNION';
select meaning into l_enabled from hr_lookups where lookup_type = 'YES_NO' and lookup_code = 'Y';
l_temp_sql:= ' SELECT '||
'''' || p_org_ent_tab(j).effective_date ||''''||' effective_org_date ,'||
'''' || p_org_ent_tab(j).date_from ||''''||' org_date_from ,'||
'''' || p_org_ent_tab(j).location_code ||''''||' location_code ,'||
'''' || p_org_ent_tab(j).internal_external_flag ||''''||' internal_external_flag ';
select meaning into l_org_classif_val from hr_lookups where lookup_type= 'ORG_CLASS' and lookup_code = p_org_ent_class_tab(i).org_classif_code;
l_temp_sql:= ' SELECT '||
'''' || p_org_oc_tab(j).effective_date ||''''||' effective_org_date ,'||
'''' || p_org_oc_tab(j).date_from ||''''||' org_date_from ,'||
'''' || p_org_oc_tab(j).location_code ||''''||' location_code ,'||
'''' || p_org_oc_tab(j).internal_external_flag ||''''||' internal_external_flag ';
select meaning into l_org_classif_val from hr_lookups where lookup_type= 'ORG_CLASS' and lookup_code = p_org_oc_class_tab(i).org_classif_code;
l_temp_sql:= ' SELECT '||
'''' || p_org_le_tab(j).effective_date ||''''||' effective_org_date ,'||
'''' || p_org_le_tab(j).date_from ||''''||' org_date_from ,'||
'''' || p_org_le_tab(j).location_code ||''''||' location_code ,'||
'''' || p_org_le_tab(j).internal_external_flag ||''''||' internal_external_flag ';
select meaning into l_org_classif_val from hr_lookups where lookup_type= 'ORG_CLASS' and lookup_code = p_org_le_class_tab(i).org_classif_code;
select end_user_column_name
from fnd_descr_flex_col_usage_vl
where descriptive_flexfield_name= 'Address Location'
and descriptive_flex_context_code = cp_style
and application_column_name = cp_app_col_name;
select terr.territory_short_name Address_Style
from fnd_territories_vl terr
where terr.territory_code = cp_style;
l_prejoin_sql := ' select decode(A.style,''GENERIC'',''Generic'',terr.territory_short_name) Address_Style '
||' from ( ';
l_temp_sql:=' SELECT '||
'''' || replace(p_location_tab(i).location_code,'''','''''') ||''''||' LOCATION_CODE ,'||
'''' || replace(p_location_tab(i).description,'''','''''') ||''''||' DESCRIPTION ,'||
'''' || l_style_val ||''''||' STYLE ,'||
'''' || replace(p_location_tab(i).address_line_1,'''','''''') ||''''||' ADDRESS_LINE_1 ,'||
'''' || per_ri_config_utilities.get_location_prompt(l_style,'ADDRESS_LINE_1') ||''''||' ADDRESS_LINE1_PROMPT ,'||
'''' || nvl(replace(p_location_tab(i).address_line_2,'''',''''''),' ') ||'''' ||' ADDRESS_LINE_2 ,'||
'''' || per_ri_config_utilities.get_location_prompt(l_style,'ADDRESS_LINE_2') ||''''||' ADDRESS_LINE2_PROMPT ,'||
'''' || nvl(replace(p_location_tab(i).address_line_3,'''',''''''),' ') ||''''||' ADDRESS_LINE_3 ,'||
'''' || per_ri_config_utilities.get_location_prompt(l_style,'ADDRESS_LINE_3') ||''''||' ADDRESS_LINE3_PROMPT ,'||
'''' || nvl(replace(p_location_tab(i).town_or_city,'''',''''''),' ') ||''''||' TOWN_OR_CITY ,'||
'''' || per_ri_config_utilities.get_location_prompt(l_style,'TOWN_OR_CITY') ||''''||' TOWN_OR_CITY_PROMPT ,'||
'''' || nvl(replace(l_country,'''',''''''),' ') ||''''||' COUNTRY ,'||
'''' || per_ri_config_utilities.get_location_prompt(l_style,'COUNTRY') ||''''||' COUNTRY_PROMPT ,'||
'''' || nvl(replace(p_location_tab(i).postal_code,'''',''''''),' ') ||''''||' POSTAL_CODE ,'||
'''' || per_ri_config_utilities.get_location_prompt(l_style,'POSTAL_CODE') ||''''||' POSTAL_CODE_PROMPT ,'||
'''' || nvl(replace(p_location_tab(i).region_1,'''',''''''),' ') ||''''||' REGION1 ,'||
'''' || per_ri_config_utilities.get_location_prompt(l_style,'REGION_1') ||''''||' REGION1_PROMPT ,'||
'''' || nvl(replace(p_location_tab(i).region_2,'''',''''''),' ') ||''''||' REGION2 ,'||
'''' || per_ri_config_utilities.get_location_prompt(l_style,'REGION_2') ||''''||' REGION2_PROMPT ,'||
'''' || nvl(replace(p_location_tab(i).region_3,'''',''''''),' ') ||''''||' REGION3 ,'||
'''' || per_ri_config_utilities.get_location_prompt(l_style,'REGION_3') ||''''||' REGION3_PROMPT ,'||
'''' || nvl(replace(p_location_tab(i).telephone_number_1,'''',''''''),' ')||''''||' TELEPHONE_NUMBER_1 ,'||
'''' || per_ri_config_utilities.get_location_prompt(l_style,'TELEPHONE_NUMBER_1')||''''||' TELEPHONE_NUMBER1_PROMPT ,'||
'''' || nvl(replace(p_location_tab(i).telephone_number_2,'''',''''''),' ')||''''||' TELEPHONE_NUMBER_2 ,'||
'''' || per_ri_config_utilities.get_location_prompt(l_style,'TELEPHONE_NUMBER_2')||''''||' TELEPHONE_NUMBER2_PROMPT ,'||
'''' || nvl(replace(p_location_tab(i).telephone_number_3,'''',''''''),' ')||''''||' TELEPHONE_NUMBER_3 ,'||
'''' || per_ri_config_utilities.get_location_prompt(l_style,'TELEPHONE_NUMBER_3')||''''||' TELEPHONE_NUMBER3_PROMPT ,'||
'''' || nvl(replace(p_location_tab(i).loc_information13,'''',''''''),' ')||''''||' LOC_INFORMATION13 ,'||
'''' || per_ri_config_utilities.get_location_prompt(l_style,'LOC_INFORMATION13') ||''''||' LOC_INFORMATION13_PROMPT ,'||
'''' || nvl(replace(p_location_tab(i).loc_information14,'''',''''''),' ')||''''||' LOC_INFORMATION14 ,'||
'''' || per_ri_config_utilities.get_location_prompt(l_style,'LOC_INFORMATION14') ||''''||' LOC_INFORMATION14_PROMPT ,'||
'''' || nvl(replace(p_location_tab(i).loc_information15,'''',''''''),' ')||''''||' LOC_INFORMATION15 ,'||
'''' || per_ri_config_utilities.get_location_prompt(l_style,'LOC_INFORMATION15') ||''''||' LOC_INFORMATION15_PROMPT ,'||
'''' || nvl(replace(p_location_tab(i).loc_information16,'''',''''''),' ')||''''||' LOC_INFORMATION16 ,'||
'''' || per_ri_config_utilities.get_location_prompt(l_style,'LOC_INFORMATION16') ||''''||' LOC_INFORMATION16_PROMPT ,'||
'''' || nvl(replace(p_location_tab(i).loc_information17,'''',''''''),' ')||''''||' LOC_INFORMATION17 ,'||
'''' || per_ri_config_utilities.get_location_prompt(l_style,'LOC_INFORMATION17')||''''||' LOC_INFORMATION17_PROMPT ,'||
'''' || nvl(replace(p_location_tab(i).loc_information18,'''',''''''),' ')||''''||' LOC_INFORMATION18 ,'||
'''' || per_ri_config_utilities.get_location_prompt(l_style,'LOC_INFORMATION18')||''''||' LOC_INFORMATION18_PROMPT ,'||
'''' || nvl(replace(p_location_tab(i).loc_information19,'''',''''''),' ')||''''||' LOC_INFORMATION19 ,'||
'''' || per_ri_config_utilities.get_location_prompt(l_style,'LOC_INFORMATION19')||''''||' LOC_INFORMATION19_PROMPT ,'||
'''' || nvl(replace(p_location_tab(i).loc_information20,'''',''''''),' ')||''''||' LOC_INFORMATION20 ,'||
'''' || per_ri_config_utilities.get_location_prompt(l_style,'LOC_INFORMATION20')||''''||' LOC_INFORMATION20_PROMPT '||
' FROM DUAL UNION';
l_temp_sql:= ' SELECT ' ||
'''' || p_user_tab(i).user_name ||''''||' user_name ,' ||
'''' || p_user_tab(i).start_date ||''''||' start_date ,'||
'''' || p_user_tab(i).description ||''''||' description '||
' FROM DUAL UNION';
l_prejoin_sql := ' select distinct A.user_name , A.resp_key ResponsibilityName ,'
||' decode(A.security_group,''STANDARD'',''Standard'',A.security_group) SecurityGroupName, '
||' app.APPLICATION_NAME ApplicationName, A.start_date from ( ';
l_temp_sql:= ' SELECT ' ||
'''' || p_resp_tab(i).user_name ||''''||' user_name ,' ||
'''' || p_resp_tab(i).resp_key ||''''||' resp_key ,' ||
'''' || p_resp_tab(i).app_short_name ||''''||' app_short_name, '||
'''' || p_resp_tab(i).security_group ||''''||' security_group,'||
'''' || p_resp_tab(i).owner ||''''||' owner,' ||
'''' || g_config_effective_date ||''''||' start_date,'||
'''' || p_resp_tab(i).end_date ||''''||' end_date,' ||
'''' || p_resp_tab(i).description ||''''||' description' ||
' FROM DUAL UNION';
l_temp_sql:= ' SELECT ' ||
'''' || p_hrms_resp_tab(i).user_name ||''''||' user_name ,' ||
'''' || p_hrms_resp_tab(i).resp_key ||''''||' resp_key ,' ||
'''' || nvl(p_hrms_resp_tab(i).app_short_name,'PER') ||''''||' app_short_name, ' ||
'''' || p_hrms_resp_tab(i).security_group ||''''||' security_group,' ||
'''' || p_hrms_resp_tab(i).owner ||''''||' owner,' ||
'''' || g_config_effective_date ||''''||' start_date,' ||
'''' || p_hrms_resp_tab(i).end_date ||''''||' end_date,' ||
'''' || p_hrms_resp_tab(i).description ||''''||' description' ||
' FROM DUAL UNION';
l_temp_sql:= ' SELECT ' ||
'''' || p_hrms_misc_resp_tab(i).user_name ||''''||' user_name ,' ||
'''' || p_hrms_misc_resp_tab(i).resp_key ||''''||' resp_key ,' ||
'''' || nvl(p_hrms_misc_resp_tab(i).app_short_name,'PER') ||''''||' app_short_name, ' ||
'''' || p_hrms_misc_resp_tab(i).security_group ||''''||' security_group,' ||
'''' || p_hrms_misc_resp_tab(i).owner ||''''||' owner,' ||
'''' || g_config_effective_date ||''''||' start_date,' ||
'''' || p_hrms_misc_resp_tab(i).end_date ||''''||' end_date,' ||
'''' || p_hrms_misc_resp_tab(i).description ||''''||' description' ||
' FROM DUAL UNION';
l_prejoin_sql := ' select A.level_x , fprf.user_profile_option_name UserProfileName,'||
' decode(A.profile_option_value, ''Y'',''Yes'',''N'',''No'',A.profile_option_value) ProfileValue, '||
' fapp.Application_Name, A.level_value from (';
select meaning into l_translated_prof_opt_value from hr_lookups where lookup_type = 'BUDGET_MEASUREMENT_TYPE' and lookup_code = 'HEAD';
select meaning into l_translated_prof_opt_value from hr_lookups where lookup_type like 'HR_GEN_GL_ORG' and lookup_code like 'CCHR';
l_temp_sql:= ' SELECT ' ||
'''' || p_profile_tab(i).level ||''''||' level_x,' ||
'''' || p_profile_tab(i).level_value ||''''||' level_value,' ||
'''' || p_profile_tab(i).level_value_app ||''''||' level_value_app,' ||
'''' || p_profile_tab(i).profile_name ||''''||' profile_name,' ||
'''' || l_translated_prof_opt_value ||''''||' profile_option_value ' ||
' FROM DUAL UNION';
select meaning into l_translated_prof_opt_value from hr_lookups where lookup_type = 'BUDGET_MEASUREMENT_TYPE' and lookup_code = 'HEAD';
l_temp_sql:= ' SELECT ' ||
'''' || p_profile_dpe_ent_tab(i).level ||''''||' level_x,' ||
'''' || p_profile_dpe_ent_tab(i).level_value ||''''||' level_value,' ||
'''' || p_profile_dpe_ent_tab(i).level_value_app ||''''||' level_value_app,' ||
'''' || p_profile_dpe_ent_tab(i).profile_name ||''''||' profile_name,' ||
'''' || l_translated_prof_opt_value ||''''||' profile_option_value ' ||
' FROM DUAL UNION';
l_prejoin_sql := ' select A.level_x , fprf.user_profile_option_name UserProfileName,'||
' decode(A.profile_option_value, ''Y'',''Yes'',''N'',''No'',A.profile_option_value) ProfileValue, '||
' fapp.Application_Name, A.level_value from (';
l_temp_sql:= ' SELECT ' ||
'''' || p_profile_apps_tab(i).level ||''''||' level_x,' ||
'''' || p_profile_apps_tab(i).level_value ||''''||' level_value,' ||
'''' || p_profile_apps_tab(i).level_value_app ||''''||' level_value_app,' ||
'''' || p_profile_apps_tab(i).profile_name ||''''||' profile_name,' ||
'''' || p_profile_apps_tab(i).profile_option_value ||''''||' profile_option_value ' ||
' FROM DUAL UNION';
l_prejoin_sql := ' select A.level_x , fprf.user_profile_option_name UserProfileName,'||
' decode(A.profile_option_value, ''Y'',''Yes'',''N'',''No'',A.profile_option_value) ProfileValue, '||
' fapp.Application_Name, A.level_value from (';
select meaning into l_prof_opt_value from fnd_lookup_values where lookup_type = 'HR_USER_TYPE' and language = userenv('LANG') and lookup_code like p_profile_resp_tab(i).profile_option_value;
l_temp_sql:= ' SELECT ' ||
'''' || p_profile_resp_tab(i).level ||''''||' level_x,' ||
'''' || p_profile_resp_tab(i).level_value ||''''||' level_value,' ||
'''' || p_profile_resp_tab(i).level_value_app ||''''||' level_value_app,' ||
'''' || p_profile_resp_tab(i).profile_name ||''''||' profile_name,' ||
'''' || l_prof_opt_value ||''''||' profile_option_value ' ||
' FROM DUAL UNION';
select meaning into l_allow_dynamic from hr_lookups where lookup_type = 'YES_NO' and lookup_code = 'Y';
l_prejoin_sql := ' select A.appl_short_name , A.flex_code ,A.structure_code,A.structure_title,A.description, A.allow_dynamic_inserts,A.segment_separator,A.enabled,A.freeze_flex_def,'||
' fapp.Application_Name from( ';
l_temp_sql:= ' SELECT ' ||
'''' || p_kf_job_tab(i).appl_short_name ||''''||' appl_short_name,' ||
'''' || p_kf_job_tab(i).flex_code ||''''||' flex_code,' ||
'''' || p_kf_job_tab(i).structure_code ||''''||' structure_code,' ||
'''' || p_kf_job_tab(i).structure_title ||''''||' structure_title,' ||
'''' || p_kf_job_tab(i).description ||''''||' description, ' ||
'''' || l_allow_dynamic ||''''||' allow_dynamic_inserts,' ||
'''' || l_segment_separator ||''''||' segment_separator,' ||
'''' || l_freeze_flex_def ||''''||' freeze_flex_def, ' ||
'''' || l_enabled ||''''||' enabled ' ||
' FROM DUAL UNION';
l_temp_sql:= ' SELECT ' ||
'''' || p_kf_job_rv_tab(i).appl_short_name ||''''||' appl_short_name,' ||
'''' || p_kf_job_rv_tab(i).flex_code ||''''||' flex_code,' ||
'''' || p_kf_job_rv_tab(i).structure_code ||''''||' structure_code,' ||
'''' || p_kf_job_rv_tab(i).structure_title ||''''||' structure_title,' ||
'''' || p_kf_job_rv_tab(i).description ||''''||' description, ' ||
'''' || l_allow_dynamic ||''''||' allow_dynamic_inserts,' ||
'''' || l_segment_separator ||''''||' segment_separator,' ||
'''' || l_freeze_flex_def ||''''||' freeze_flex_def, ' ||
'''' || l_enabled ||''''||' enabled ' ||
' FROM DUAL UNION';
l_temp_sql:= ' SELECT ' ||
'''' || p_kf_job_no_rv_tab(i).appl_short_name ||''''||' appl_short_name,' ||
'''' || p_kf_job_no_rv_tab(i).flex_code ||''''||' flex_code,' ||
'''' || p_kf_job_no_rv_tab(i).structure_code ||''''||' structure_code,' ||
'''' || p_kf_job_no_rv_tab(i).structure_title ||''''||' structure_title,' ||
'''' || p_kf_job_no_rv_tab(i).description ||''''||' description, ' ||
'''' || l_allow_dynamic ||''''||' allow_dynamic_inserts,' ||
'''' || l_segment_separator ||''''||' segment_separator,' ||
'''' || l_freeze_flex_def ||''''||' freeze_flex_def, ' ||
'''' || l_enabled ||''''||' enabled ' ||
' FROM DUAL UNION';
l_temp_sql:= ' SELECT ' ||
'''' || p_kf_pos_tab(i).appl_short_name ||''''||' appl_short_name,' ||
'''' || p_kf_pos_tab(i).flex_code ||''''||' flex_code,' ||
'''' || p_kf_pos_tab(i).structure_code ||''''||' structure_code,' ||
'''' || p_kf_pos_tab(i).structure_title ||''''||' structure_title,' ||
'''' || p_kf_pos_tab(i).description ||''''||' description, ' ||
'''' || l_allow_dynamic ||''''||' allow_dynamic_inserts,' ||
'''' || l_segment_separator ||''''||' segment_separator,' ||
'''' || l_enabled ||''''||' enabled, ' ||
'''' || l_freeze_flex_def ||''''||' freeze_flex_def ' ||
' FROM DUAL UNION';
l_temp_sql:= ' SELECT ' ||
'''' || p_kf_pos_rv_tab(i).appl_short_name ||''''||' appl_short_name,' ||
'''' || p_kf_pos_rv_tab(i).flex_code ||''''||' flex_code,' ||
'''' || p_kf_pos_rv_tab(i).structure_code ||''''||' structure_code,' ||
'''' || p_kf_pos_rv_tab(i).structure_title ||''''||' structure_title,' ||
'''' || p_kf_pos_rv_tab(i).description ||''''||' description, ' ||
'''' || l_allow_dynamic ||''''||' allow_dynamic_inserts,' ||
'''' || l_segment_separator ||''''||' segment_separator,' ||
'''' || l_enabled ||''''||' enabled, ' ||
'''' || l_freeze_flex_def ||''''||' freeze_flex_def ' ||
' FROM DUAL UNION';
l_temp_sql:= ' SELECT ' ||
'''' || p_kf_pos_no_rv_tab(i).appl_short_name ||''''||' appl_short_name,' ||
'''' || p_kf_pos_no_rv_tab(i).flex_code ||''''||' flex_code,' ||
'''' || p_kf_pos_no_rv_tab(i).structure_code ||''''||' structure_code,' ||
'''' || p_kf_pos_no_rv_tab(i).structure_title ||''''||' structure_title,' ||
'''' || p_kf_pos_no_rv_tab(i).description ||''''||' description, ' ||
'''' || l_allow_dynamic ||''''||' allow_dynamic_inserts,' ||
'''' || l_segment_separator ||''''||' segment_separator,' ||
'''' || l_enabled ||''''||' enabled, ' ||
'''' || l_freeze_flex_def ||''''||' freeze_flex_def ' ||
' FROM DUAL UNION';
l_temp_sql:= ' SELECT ' ||
'''' || p_kf_grd_tab(i).appl_short_name ||''''||' appl_short_name,' ||
'''' || p_kf_grd_tab(i).flex_code ||''''||' flex_code,' ||
'''' || p_kf_grd_tab(i).structure_code ||''''||' structure_code,' ||
'''' || p_kf_grd_tab(i).structure_title ||''''||' structure_title,' ||
'''' || p_kf_grd_tab(i).description ||''''||' description,' ||
'''' || l_allow_dynamic ||''''||' allow_dynamic_inserts,' ||
'''' || l_segment_separator ||''''||' segment_separator,' ||
'''' || l_enabled ||''''||' enabled, ' ||
'''' || l_freeze_flex_def ||''''||' freeze_flex_def ' ||
' FROM DUAL UNION';
l_temp_sql:= ' SELECT ' ||
'''' || p_kf_grd_rv_tab(i).appl_short_name ||''''||' appl_short_name,' ||
'''' || p_kf_grd_rv_tab(i).flex_code ||''''||' flex_code,' ||
'''' || p_kf_grd_rv_tab(i).structure_code ||''''||' structure_code,' ||
'''' || p_kf_grd_rv_tab(i).structure_title ||''''||' structure_title,' ||
'''' || p_kf_grd_rv_tab(i).description ||''''||' description,' ||
'''' || l_allow_dynamic ||''''||' allow_dynamic_inserts,' ||
'''' || l_segment_separator ||''''||' segment_separator,' ||
'''' || l_enabled ||''''||' enabled, ' ||
'''' || l_freeze_flex_def ||''''||' freeze_flex_def ' ||
' FROM DUAL UNION';
l_temp_sql:= ' SELECT ' ||
'''' || p_kf_grd_no_rv_tab(i).appl_short_name ||''''||' appl_short_name,' ||
'''' || p_kf_grd_no_rv_tab(i).flex_code ||''''||' flex_code,' ||
'''' || p_kf_grd_no_rv_tab(i).structure_code ||''''||' structure_code,' ||
'''' || p_kf_grd_no_rv_tab(i).structure_title ||''''||' structure_title,' ||
'''' || p_kf_grd_no_rv_tab(i).description ||''''||' description,' ||
'''' || l_allow_dynamic ||''''||' allow_dynamic_inserts,' ||
'''' || l_segment_separator ||''''||' segment_separator,' ||
'''' || l_enabled ||''''||' enabled, ' ||
'''' || l_freeze_flex_def ||''''||' freeze_flex_def ' ||
' FROM DUAL UNION';
l_temp_sql:= ' SELECT ' ||
'''' || p_kf_cmp_tab(i).appl_short_name ||''''||' appl_short_name,' ||
'''' || p_kf_cmp_tab(i).flex_code ||''''||' flex_code,' ||
'''' || p_kf_cmp_tab(i).structure_code ||''''||' structure_code,' ||
'''' || p_kf_cmp_tab(i).structure_title ||''''||' structure_title,' ||
'''' || p_kf_cmp_tab(i).description ||''''||' description, ' ||
'''' || l_allow_dynamic ||''''||' allow_dynamic_inserts,' ||
'''' || l_segment_separator ||''''||' segment_separator,' ||
'''' || l_enabled ||''''||' enabled, ' ||
'''' || l_freeze_flex_def ||''''||' freeze_flex_def ' ||
' FROM DUAL UNION';
l_temp_sql:= ' SELECT ' ||
'''' || p_kf_grp_tab(i).appl_short_name ||''''||' appl_short_name,' ||
'''' || p_kf_grp_tab(i).flex_code ||''''||' flex_code,' ||
'''' || p_kf_grp_tab(i).structure_code ||''''||' structure_code,' ||
'''' || p_kf_grp_tab(i).structure_title ||''''||' structure_title,' ||
'''' || p_kf_grp_tab(i).description ||''''||' description,' ||
'''' || l_allow_dynamic ||''''||' allow_dynamic_inserts,' ||
'''' || l_segment_separator ||''''||' segment_separator,' ||
'''' || l_enabled ||''''||' enabled, ' ||
'''' || l_freeze_flex_def ||''''||' freeze_flex_def ' ||
' FROM DUAL UNION';
l_temp_sql:= ' SELECT ' ||
'''' || p_kf_cost_tab(i).appl_short_name ||''''||' appl_short_name,' ||
'''' || p_kf_cost_tab(i).flex_code ||''''||' flex_code,' ||
'''' || p_kf_cost_tab(i).structure_code ||''''||' structure_code,' ||
'''' || p_kf_cost_tab(i).structure_title ||''''||' structure_title,' ||
'''' || p_kf_cost_tab(i).description ||''''||' description,' ||
'''' || l_allow_dynamic ||''''||' allow_dynamic_inserts,' ||
'''' || l_segment_separator ||''''||' segment_separator,' ||
'''' || l_enabled ||''''||' enabled, ' ||
'''' || l_freeze_flex_def ||''''||' freeze_flex_def ' ||
' FROM DUAL UNION';
select meaning into l_required from hr_lookups where lookup_type = 'YES_NO' and lookup_code = 'Y';
select meaning into l_vs_validation_type from fnd_lookups where lookup_type = 'SEG_VAL_TYPES' and lookup_code = 'I';
select meaning into l_vs_security_available from hr_lookups where lookup_type = 'YES_NO' and lookup_code = p_kf_job_seg_tab(i).vs_security_available;
select meaning into l_vs_enable_longlist from fnd_lookups where lookup_type = 'FLEX_VALUESET_LONGLIST_FLAG' and lookup_code = p_kf_job_seg_tab(i).vs_enable_longlist;
select meaning into l_vs_format_type from fnd_lookups where lookup_type = 'FIELD_TYPE' and lookup_code = p_kf_job_seg_tab(i).vs_format_type;
l_temp_sql:= ' SELECT ' ||
'''' || p_kf_job_seg_tab(i).appl_short_name ||''''||' appl_short_name,' ||
'''' || p_kf_job_seg_tab(i).flex_code ||''''||' flex_code,' ||
'''' || p_kf_job_seg_tab(i).structure_code ||''''||' structure_code,' ||
'''' || p_kf_job_seg_tab(i).segment_name ||''''||' segment_name,' ||
'''' || p_kf_job_seg_tab(i).column_name ||''''||' column_name,' ||
'''' || p_kf_job_seg_tab(i).segment_number ||''''||' segment_number,' ||
'''' || p_kf_job_seg_tab(i).value_set ||''''||' value_set,' ||
'''' || p_kf_job_seg_tab(i).lov_prompt ||''''||' lov_prompt,' ||
'''' || p_kf_job_seg_tab(i).segment_type ||''''||' segment_type,' ||
'''' || p_kf_job_seg_tab(i).window_prompt ||''''||' window_prompt,' ||
'''' || l_required ||''''||' required,' ||
'''' || l_display ||''''||' display,' ||
'''' || l_enabled ||''''||' enabled, ' ||
'''' || l_vs_validation_type ||''''||' vs_validation_type, ' ||
'''' || p_kf_job_seg_tab(i).vs_description ||''''||' vs_description,' ||
'''' || l_vs_security_available ||''''||' vs_security_available,' ||
'''' || l_vs_enable_longlist ||''''||' vs_list_type,' || --List type
'''' || l_vs_format_type ||''''||' vs_format_type,' || --validation type
'''' || p_kf_job_seg_tab(i).vs_maximum_size ||''''||' vs_maximum_size,' ||
'''' || p_kf_job_seg_tab(i).vs_precision ||''''||' vs_precision,' ||
'''' || p_kf_job_seg_tab(i).vs_numbers_only ||''''||' vs_numbers_only,' ||
'''' || p_kf_job_seg_tab(i).vs_uppercase_only ||''''||' vs_uppercase_only,' ||
'''' || p_kf_job_seg_tab(i).vs_right_justify_zero_fill ||''''||' vs_right_justify_zero_fill,' ||
'''' || p_kf_job_seg_tab(i).vs_min_value ||''''||' vs_min_value,' ||
'''' || p_kf_job_seg_tab(i).vs_max_value ||''''||' vs_max_value,' ||
'''' || p_kf_job_seg_tab(i).vs_value_set_name ||''''||' value_set_name' ||
' FROM DUAL UNION';
select meaning into l_vs_security_available from hr_lookups where lookup_type = 'YES_NO' and lookup_code = p_kf_job_rv_seg_tab(i).vs_security_available;
select meaning into l_vs_enable_longlist from fnd_lookups where lookup_type = 'FLEX_VALUESET_LONGLIST_FLAG' and lookup_code = p_kf_job_rv_seg_tab(i).vs_enable_longlist;
select meaning into l_vs_format_type from fnd_lookups where lookup_type = 'FIELD_TYPE' and lookup_code = p_kf_job_rv_seg_tab(i).vs_format_type;
l_temp_sql:= ' SELECT ' ||
'''' || p_kf_job_rv_seg_tab(i).appl_short_name ||''''||' appl_short_name,' ||
'''' || p_kf_job_rv_seg_tab(i).flex_code ||''''||' flex_code,' ||
'''' || p_kf_job_rv_seg_tab(i).structure_code ||''''||' structure_code,' ||
'''' || p_kf_job_rv_seg_tab(i).segment_name ||''''||' segment_name,' ||
'''' || p_kf_job_rv_seg_tab(i).column_name ||''''||' column_name,' ||
'''' || p_kf_job_rv_seg_tab(i).segment_number ||''''||' segment_number,' ||
'''' || p_kf_job_rv_seg_tab(i).value_set ||''''||' value_set,' ||
'''' || p_kf_job_rv_seg_tab(i).lov_prompt ||''''||' lov_prompt,' ||
'''' || p_kf_job_rv_seg_tab(i).segment_type ||''''||' segment_type,' ||
'''' || p_kf_job_rv_seg_tab(i).window_prompt ||''''||' window_prompt,' ||
'''' || l_required ||''''||' required,' ||
'''' || l_display ||''''||' display,' ||
'''' || l_enabled ||''''||' enabled, ' ||
'''' || l_vs_validation_type ||''''||' vs_validation_type, ' ||
'''' || p_kf_job_rv_seg_tab(i).vs_description ||''''||' vs_description,' ||
'''' || l_vs_security_available ||''''||' vs_security_available,' ||
'''' || l_vs_enable_longlist ||''''||' vs_list_type,' || --List type
'''' || l_vs_format_type ||''''||' vs_format_type,' || --validation type
'''' || p_kf_job_rv_seg_tab(i).vs_maximum_size ||''''||' vs_maximum_size,' ||
'''' || p_kf_job_rv_seg_tab(i).vs_precision ||''''||' vs_precision,' ||
'''' || p_kf_job_rv_seg_tab(i).vs_numbers_only ||''''||' vs_numbers_only,' ||
'''' || p_kf_job_rv_seg_tab(i).vs_uppercase_only ||''''||' vs_uppercase_only,' ||
'''' || p_kf_job_rv_seg_tab(i).vs_right_justify_zero_fill ||''''||' vs_right_justify_zero_fill,' ||
'''' || p_kf_job_rv_seg_tab(i).vs_min_value ||''''||' vs_min_value,' ||
'''' || p_kf_job_rv_seg_tab(i).vs_max_value ||''''||' vs_max_value,' ||
'''' || p_kf_job_rv_seg_tab(i).vs_value_set_name ||''''||' value_set_name' ||
' FROM DUAL UNION';
select meaning into l_vs_security_available from hr_lookups where lookup_type = 'YES_NO' and lookup_code = p_kf_job_no_rv_seg_tab(i).vs_security_available;
select meaning into l_vs_enable_longlist from fnd_lookups where lookup_type = 'FLEX_VALUESET_LONGLIST_FLAG' and lookup_code = p_kf_job_no_rv_seg_tab(i).vs_enable_longlist;
select meaning into l_vs_format_type from fnd_lookups where lookup_type = 'FIELD_TYPE' and lookup_code = p_kf_job_no_rv_seg_tab(i).vs_format_type;
l_temp_sql:= ' SELECT ' ||
'''' || p_kf_job_no_rv_seg_tab(i).appl_short_name ||''''||' appl_short_name,' ||
'''' || p_kf_job_no_rv_seg_tab(i).flex_code ||''''||' flex_code,' ||
'''' || p_kf_job_no_rv_seg_tab(i).structure_code ||''''||' structure_code,' ||
'''' || p_kf_job_no_rv_seg_tab(i).segment_name ||''''||' segment_name,' ||
'''' || p_kf_job_no_rv_seg_tab(i).column_name ||''''||' column_name,' ||
'''' || p_kf_job_no_rv_seg_tab(i).segment_number ||''''||' segment_number,' ||
'''' || p_kf_job_no_rv_seg_tab(i).value_set ||''''||' value_set,' ||
'''' || p_kf_job_no_rv_seg_tab(i).lov_prompt ||''''||' lov_prompt,' ||
'''' || p_kf_job_no_rv_seg_tab(i).segment_type ||''''||' segment_type,' ||
'''' || p_kf_job_no_rv_seg_tab(i).window_prompt ||''''||' window_prompt,' ||
'''' || l_required ||''''||' required,' ||
'''' || l_display ||''''||' display,' ||
'''' || l_enabled ||''''||' enabled,' ||
'''' || l_vs_validation_type ||''''||' vs_validation_type, ' ||
'''' || p_kf_job_no_rv_seg_tab(i).vs_description ||''''||' vs_description,' ||
'''' || l_vs_security_available ||''''||' vs_security_available,' ||
'''' || l_vs_enable_longlist ||''''||' vs_list_type,' || --List type
'''' || l_vs_format_type ||''''||' vs_format_type,' || --validation type
'''' || p_kf_job_no_rv_seg_tab(i).vs_maximum_size ||''''||' vs_maximum_size,' ||
'''' || p_kf_job_no_rv_seg_tab(i).vs_precision ||''''||' vs_precision,' ||
'''' || p_kf_job_no_rv_seg_tab(i).vs_numbers_only ||''''||' vs_numbers_only,' ||
'''' || p_kf_job_no_rv_seg_tab(i).vs_uppercase_only ||''''||' vs_uppercase_only,' ||
'''' || p_kf_job_no_rv_seg_tab(i).vs_right_justify_zero_fill ||''''||' vs_right_justify_zero_fill,' ||
'''' || p_kf_job_no_rv_seg_tab(i).vs_min_value ||''''||' vs_min_value,' ||
'''' || p_kf_job_no_rv_seg_tab(i).vs_max_value ||''''||' vs_max_value,' ||
'''' || p_kf_job_no_rv_seg_tab(i).vs_value_set_name ||''''||' value_set_name' ||
' FROM DUAL UNION';
select meaning into l_vs_security_available from hr_lookups where lookup_type = 'YES_NO' and lookup_code = p_kf_pos_seg_tab(i).vs_security_available;
select meaning into l_vs_enable_longlist from fnd_lookups where lookup_type = 'FLEX_VALUESET_LONGLIST_FLAG' and lookup_code = p_kf_pos_seg_tab(i).vs_enable_longlist;
select meaning into l_vs_format_type from fnd_lookups where lookup_type = 'FIELD_TYPE' and lookup_code = p_kf_pos_seg_tab(i).vs_format_type;
l_temp_sql:= ' SELECT ' ||
'''' || p_kf_pos_seg_tab(i).appl_short_name ||''''||' appl_short_name,' ||
'''' || p_kf_pos_seg_tab(i).flex_code ||''''||' flex_code,' ||
'''' || p_kf_pos_seg_tab(i).structure_code ||''''||' structure_code,' ||
'''' || p_kf_pos_seg_tab(i).segment_name ||''''||' segment_name,' ||
'''' || p_kf_pos_seg_tab(i).column_name ||''''||' column_name,' ||
'''' || p_kf_pos_seg_tab(i).segment_number ||''''||' segment_number,' ||
'''' || p_kf_pos_seg_tab(i).value_set ||''''||' value_set,' ||
'''' || p_kf_pos_seg_tab(i).lov_prompt ||''''||' lov_prompt,' ||
'''' || p_kf_pos_seg_tab(i).segment_type ||''''||' segment_type,' ||
'''' || p_kf_pos_seg_tab(i).window_prompt ||''''||' window_prompt,' ||
'''' || l_required ||''''||' required,' ||
'''' || l_display ||''''||' display,' ||
'''' || l_enabled ||''''||' enabled, ' ||
'''' || l_vs_validation_type ||''''||' vs_validation_type, ' ||
'''' || p_kf_pos_seg_tab(i).vs_description ||''''||' vs_description,' ||
'''' || l_vs_security_available ||''''||' vs_security_available,' ||
'''' || l_vs_enable_longlist ||''''||' vs_list_type,' || --List type
'''' || l_vs_format_type ||''''||' vs_format_type,' || --validation type
'''' || p_kf_pos_seg_tab(i).vs_maximum_size ||''''||' vs_maximum_size,' ||
'''' || p_kf_pos_seg_tab(i).vs_precision ||''''||' vs_precision,' ||
'''' || p_kf_pos_seg_tab(i).vs_numbers_only ||''''||' vs_numbers_only,' ||
'''' || p_kf_pos_seg_tab(i).vs_uppercase_only ||''''||' vs_uppercase_only,' ||
'''' || p_kf_pos_seg_tab(i).vs_right_justify_zero_fill ||''''||' vs_right_justify_zero_fill,' ||
'''' || p_kf_pos_seg_tab(i).vs_min_value ||''''||' vs_min_value,' ||
'''' || p_kf_pos_seg_tab(i).vs_max_value ||''''||' vs_max_value,' ||
'''' || p_kf_pos_seg_tab(i).vs_value_set_name ||''''||' value_set_name' ||
' FROM DUAL UNION';
select meaning into l_vs_security_available from hr_lookups where lookup_type = 'YES_NO' and lookup_code = p_kf_pos_rv_seg_tab(i).vs_security_available;
select meaning into l_vs_enable_longlist from fnd_lookups where lookup_type = 'FLEX_VALUESET_LONGLIST_FLAG' and lookup_code = p_kf_pos_rv_seg_tab(i).vs_enable_longlist;
select meaning into l_vs_format_type from fnd_lookups where lookup_type = 'FIELD_TYPE' and lookup_code = p_kf_pos_rv_seg_tab(i).vs_format_type;
l_temp_sql:= ' SELECT ' ||
'''' || p_kf_pos_rv_seg_tab(i).appl_short_name ||''''||' appl_short_name,' ||
'''' || p_kf_pos_rv_seg_tab(i).flex_code ||''''||' flex_code,' ||
'''' || p_kf_pos_rv_seg_tab(i).structure_code ||''''||' structure_code,' ||
'''' || p_kf_pos_rv_seg_tab(i).segment_name ||''''||' segment_name,' ||
'''' || p_kf_pos_rv_seg_tab(i).column_name ||''''||' column_name,' ||
'''' || p_kf_pos_rv_seg_tab(i).segment_number ||''''||' segment_number,' ||
'''' || p_kf_pos_rv_seg_tab(i).value_set ||''''||' value_set,' ||
'''' || p_kf_pos_rv_seg_tab(i).lov_prompt ||''''||' lov_prompt,' ||
'''' || p_kf_pos_rv_seg_tab(i).segment_type ||''''||' segment_type,' ||
'''' || p_kf_pos_rv_seg_tab(i).window_prompt ||''''||' window_prompt,' ||
'''' || l_required ||''''||' required,' ||
'''' || l_display ||''''||' display,' ||
'''' || l_enabled ||''''||' enabled, ' ||
'''' || l_vs_validation_type ||''''||' vs_validation_type, ' ||
'''' || p_kf_pos_rv_seg_tab(i).vs_description ||''''||' vs_description, ' ||
'''' || l_vs_security_available ||''''||' vs_security_available,' ||
'''' || l_vs_enable_longlist ||''''||' vs_list_type,' || --List type
'''' || l_vs_format_type ||''''||' vs_format_type,' || --validation type
'''' || p_kf_pos_rv_seg_tab(i).vs_maximum_size ||''''||' vs_maximum_size,' ||
'''' || p_kf_pos_rv_seg_tab(i).vs_precision ||''''||' vs_precision,' ||
'''' || p_kf_pos_rv_seg_tab(i).vs_numbers_only ||''''||' vs_numbers_only,' ||
'''' || p_kf_pos_rv_seg_tab(i).vs_uppercase_only ||''''||' vs_uppercase_only,' ||
'''' || p_kf_pos_rv_seg_tab(i).vs_right_justify_zero_fill ||''''||' vs_right_justify_zero_fill,' ||
'''' || p_kf_pos_rv_seg_tab(i).vs_min_value ||''''||' vs_min_value,' ||
'''' || p_kf_pos_rv_seg_tab(i).vs_max_value ||''''||' vs_max_value,' ||
'''' || p_kf_pos_rv_seg_tab(i).vs_value_set_name ||''''||' value_set_name' ||
' FROM DUAL UNION';
select meaning into l_vs_security_available from hr_lookups where lookup_type = 'YES_NO' and lookup_code = p_kf_pos_no_rv_seg_tab(i).vs_security_available;
select meaning into l_vs_enable_longlist from fnd_lookups where lookup_type = 'FLEX_VALUESET_LONGLIST_FLAG' and lookup_code = p_kf_pos_no_rv_seg_tab(i).vs_enable_longlist;
select meaning into l_vs_format_type from fnd_lookups where lookup_type = 'FIELD_TYPE' and lookup_code = p_kf_pos_no_rv_seg_tab(i).vs_format_type;
l_temp_sql:= ' SELECT ' ||
'''' || p_kf_pos_no_rv_seg_tab(i).appl_short_name ||''''||' appl_short_name,' ||
'''' || p_kf_pos_no_rv_seg_tab(i).flex_code ||''''||' flex_code,' ||
'''' || p_kf_pos_no_rv_seg_tab(i).structure_code ||''''||' structure_code,' ||
'''' || p_kf_pos_no_rv_seg_tab(i).segment_name ||''''||' segment_name,' ||
'''' || p_kf_pos_no_rv_seg_tab(i).column_name ||''''||' column_name,' ||
'''' || p_kf_pos_no_rv_seg_tab(i).segment_number ||''''||' segment_number,' ||
'''' || p_kf_pos_no_rv_seg_tab(i).value_set ||''''||' value_set,' ||
'''' || p_kf_pos_no_rv_seg_tab(i).lov_prompt ||''''||' lov_prompt,' ||
'''' || p_kf_pos_no_rv_seg_tab(i).segment_type ||''''||' segment_type,' ||
'''' || p_kf_pos_no_rv_seg_tab(i).window_prompt ||''''||' window_prompt,' ||
'''' || l_required ||''''||' required,' ||
'''' || l_display ||''''||' display,' ||
'''' || l_enabled ||''''||' enabled, ' ||
'''' || l_vs_validation_type ||''''||' vs_validation_type, ' ||
'''' || p_kf_pos_no_rv_seg_tab(i).vs_description ||''''||' vs_description, ' ||
'''' || l_vs_security_available ||''''||' vs_security_available,' ||
'''' || l_vs_enable_longlist ||''''||' vs_list_type,' || --List type
'''' || l_vs_format_type ||''''||' vs_format_type,' || --validation type
'''' || p_kf_pos_no_rv_seg_tab(i).vs_maximum_size ||''''||' vs_maximum_size,' ||
'''' || p_kf_pos_no_rv_seg_tab(i).vs_precision ||''''||' vs_precision,' ||
'''' || p_kf_pos_no_rv_seg_tab(i).vs_numbers_only ||''''||' vs_numbers_only,' ||
'''' || p_kf_pos_no_rv_seg_tab(i).vs_uppercase_only ||''''||' vs_uppercase_only,' ||
'''' || p_kf_pos_no_rv_seg_tab(i).vs_right_justify_zero_fill ||''''||' vs_right_justify_zero_fill,' ||
'''' || p_kf_pos_no_rv_seg_tab(i).vs_min_value ||''''||' vs_min_value,' ||
'''' || p_kf_pos_no_rv_seg_tab(i).vs_max_value ||''''||' vs_max_value,' ||
'''' || p_kf_pos_no_rv_seg_tab(i).vs_value_set_name ||''''||' value_set_name' ||
' FROM DUAL UNION';
select meaning into l_vs_security_available from hr_lookups where lookup_type = 'YES_NO' and lookup_code = p_kf_grd_seg_tab(i).vs_security_available;
select meaning into l_vs_enable_longlist from fnd_lookups where lookup_type = 'FLEX_VALUESET_LONGLIST_FLAG' and lookup_code = p_kf_grd_seg_tab(i).vs_enable_longlist;
select meaning into l_vs_format_type from fnd_lookups where lookup_type = 'FIELD_TYPE' and lookup_code = p_kf_grd_seg_tab(i).vs_format_type;
l_temp_sql:= ' SELECT ' ||
'''' || p_kf_grd_seg_tab(i).appl_short_name ||''''||' appl_short_name,' ||
'''' || p_kf_grd_seg_tab(i).flex_code ||''''||' flex_code,' ||
'''' || p_kf_grd_seg_tab(i).structure_code ||''''||' structure_code,' ||
'''' || p_kf_grd_seg_tab(i).segment_name ||''''||' segment_name,' ||
'''' || p_kf_grd_seg_tab(i).column_name ||''''||' column_name,' ||
'''' || p_kf_grd_seg_tab(i).segment_number ||''''||' segment_number,' ||
'''' || p_kf_grd_seg_tab(i).value_set ||''''||' value_set,' ||
'''' || p_kf_grd_seg_tab(i).lov_prompt ||''''||' lov_prompt,' ||
'''' || p_kf_grd_seg_tab(i).segment_type ||''''||' segment_type,' ||
'''' || p_kf_grd_seg_tab(i).window_prompt ||''''||' window_prompt,' ||
'''' || l_required ||''''||' required,' ||
'''' || l_display ||''''||' display,' ||
'''' || l_enabled ||''''||' enabled ,' ||
'''' || l_vs_validation_type ||''''||' vs_validation_type, ' ||
'''' || p_kf_grd_seg_tab(i).vs_description ||''''||' vs_description,' ||
'''' || l_vs_security_available ||''''||' vs_security_available,' ||
'''' || l_vs_enable_longlist ||''''||' vs_list_type,' || --List type
'''' || l_vs_format_type ||''''||' vs_format_type,' || --validation type
'''' || p_kf_grd_seg_tab(i).vs_maximum_size ||''''||' vs_maximum_size,' ||
'''' || p_kf_grd_seg_tab(i).vs_precision ||''''||' vs_precision,' ||
'''' || p_kf_grd_seg_tab(i).vs_numbers_only ||''''||' vs_numbers_only,' ||
'''' || p_kf_grd_seg_tab(i).vs_uppercase_only ||''''||' vs_uppercase_only,' ||
'''' || p_kf_grd_seg_tab(i).vs_right_justify_zero_fill ||''''||' vs_right_justify_zero_fill,' ||
'''' || p_kf_grd_seg_tab(i).vs_min_value ||''''||' vs_min_value,' ||
'''' || p_kf_grd_seg_tab(i).vs_max_value ||''''||' vs_max_value,' ||
'''' || p_kf_grd_seg_tab(i).vs_value_set_name ||''''||' value_set_name' ||
' FROM DUAL UNION';
select meaning into l_vs_security_available from hr_lookups where lookup_type = 'YES_NO' and lookup_code = p_kf_grd_rv_seg_tab(i).vs_security_available;
select meaning into l_vs_enable_longlist from fnd_lookups where lookup_type = 'FLEX_VALUESET_LONGLIST_FLAG' and lookup_code = p_kf_grd_rv_seg_tab(i).vs_enable_longlist;
select meaning into l_vs_format_type from fnd_lookups where lookup_type = 'FIELD_TYPE' and lookup_code = p_kf_grd_rv_seg_tab(i).vs_format_type;
l_temp_sql:= ' SELECT ' ||
'''' || p_kf_grd_rv_seg_tab(i).appl_short_name ||''''||' appl_short_name,' ||
'''' || p_kf_grd_rv_seg_tab(i).flex_code ||''''||' flex_code,' ||
'''' || p_kf_grd_rv_seg_tab(i).structure_code ||''''||' structure_code,' ||
'''' || p_kf_grd_rv_seg_tab(i).segment_name ||''''||' segment_name,' ||
'''' || p_kf_grd_rv_seg_tab(i).column_name ||''''||' column_name,' ||
'''' || p_kf_grd_rv_seg_tab(i).segment_number ||''''||' segment_number,' ||
'''' || p_kf_grd_rv_seg_tab(i).value_set ||''''||' value_set,' ||
'''' || p_kf_grd_rv_seg_tab(i).lov_prompt ||''''||' lov_prompt,' ||
'''' || p_kf_grd_rv_seg_tab(i).segment_type ||''''||' segment_type,' ||
'''' || p_kf_grd_rv_seg_tab(i).window_prompt ||''''||' window_prompt,' ||
'''' || l_required ||''''||' required,' ||
'''' || l_display ||''''||' display,' ||
'''' || l_enabled ||''''||' enabled, ' ||
'''' || l_vs_validation_type ||''''||' vs_validation_type, ' ||
'''' || p_kf_grd_rv_seg_tab(i).vs_description ||''''||' vs_description, ' ||
'''' || l_vs_security_available ||''''||' vs_security_available,' ||
'''' || l_vs_enable_longlist ||''''||' vs_list_type,' || --List type
'''' || l_vs_format_type ||''''||' vs_format_type,' || --validation type
'''' || p_kf_grd_rv_seg_tab(i).vs_maximum_size ||''''||' vs_maximum_size,' ||
'''' || p_kf_grd_rv_seg_tab(i).vs_precision ||''''||' vs_precision,' ||
'''' || p_kf_grd_rv_seg_tab(i).vs_numbers_only ||''''||' vs_numbers_only,' ||
'''' || p_kf_grd_rv_seg_tab(i).vs_uppercase_only ||''''||' vs_uppercase_only,' ||
'''' || p_kf_grd_rv_seg_tab(i).vs_right_justify_zero_fill ||''''||' vs_right_justify_zero_fill,' ||
'''' || p_kf_grd_rv_seg_tab(i).vs_min_value ||''''||' vs_min_value,' ||
'''' || p_kf_grd_rv_seg_tab(i).vs_max_value ||''''||' vs_max_value,' ||
'''' || p_kf_grd_rv_seg_tab(i).vs_value_set_name ||''''||' value_set_name' ||
' FROM DUAL UNION';
select meaning into l_vs_security_available from hr_lookups where lookup_type = 'YES_NO' and lookup_code = p_kf_grd_no_rv_seg_tab(i).vs_security_available;
select meaning into l_vs_enable_longlist from fnd_lookups where lookup_type = 'FLEX_VALUESET_LONGLIST_FLAG' and lookup_code = p_kf_grd_no_rv_seg_tab(i).vs_enable_longlist;
select meaning into l_vs_format_type from fnd_lookups where lookup_type = 'FIELD_TYPE' and lookup_code = p_kf_grd_no_rv_seg_tab(i).vs_format_type;
l_temp_sql:= ' SELECT ' ||
'''' || p_kf_grd_no_rv_seg_tab(i).appl_short_name ||''''||' appl_short_name,' ||
'''' || p_kf_grd_no_rv_seg_tab(i).flex_code ||''''||' flex_code,' ||
'''' || p_kf_grd_no_rv_seg_tab(i).structure_code ||''''||' structure_code,' ||
'''' || p_kf_grd_no_rv_seg_tab(i).segment_name ||''''||' segment_name,' ||
'''' || p_kf_grd_no_rv_seg_tab(i).column_name ||''''||' column_name,' ||
'''' || p_kf_grd_no_rv_seg_tab(i).segment_number ||''''||' segment_number,' ||
'''' || p_kf_grd_no_rv_seg_tab(i).value_set ||''''||' value_set,' ||
'''' || p_kf_grd_no_rv_seg_tab(i).lov_prompt ||''''||' lov_prompt,' ||
'''' || p_kf_grd_no_rv_seg_tab(i).segment_type ||''''||' segment_type,' ||
'''' || p_kf_grd_no_rv_seg_tab(i).window_prompt ||''''||' window_prompt,' ||
'''' || l_required ||''''||' required,' ||
'''' || l_display ||''''||' display,' ||
'''' || l_enabled ||''''||' enabled,' ||
'''' || l_vs_validation_type ||''''||' vs_validation_type, ' ||
'''' || p_kf_grd_no_rv_seg_tab(i).vs_description ||''''||' vs_description,' ||
'''' || l_vs_security_available ||''''||' vs_security_available,' ||
'''' || l_vs_enable_longlist ||''''||' vs_list_type,' || --List type
'''' || l_vs_format_type ||''''||' vs_format_type,' || --validation type
'''' || p_kf_grd_no_rv_seg_tab(i).vs_maximum_size ||''''||' vs_maximum_size,' ||
'''' || p_kf_grd_no_rv_seg_tab(i).vs_precision ||''''||' vs_precision,' ||
'''' || p_kf_grd_no_rv_seg_tab(i).vs_numbers_only ||''''||' vs_numbers_only,' ||
'''' || p_kf_grd_no_rv_seg_tab(i).vs_uppercase_only ||''''||' vs_uppercase_only,' ||
'''' || p_kf_grd_no_rv_seg_tab(i).vs_right_justify_zero_fill ||''''||' vs_right_justify_zero_fill,' ||
'''' || p_kf_grd_no_rv_seg_tab(i).vs_min_value ||''''||' vs_min_value,' ||
'''' || p_kf_grd_no_rv_seg_tab(i).vs_max_value ||''''||' vs_max_value,' ||
'''' || p_kf_grd_no_rv_seg_tab(i).vs_value_set_name ||''''||' value_set_name' ||
' FROM DUAL UNION';
select meaning into l_vs_security_available from hr_lookups where lookup_type = 'YES_NO' and lookup_code = p_kf_grp_seg_tab(i).vs_security_available;
select meaning into l_vs_enable_longlist from fnd_lookups where lookup_type = 'FLEX_VALUESET_LONGLIST_FLAG' and lookup_code = p_kf_grp_seg_tab(i).vs_enable_longlist;
select meaning into l_vs_format_type from fnd_lookups where lookup_type = 'FIELD_TYPE' and lookup_code = p_kf_grp_seg_tab(i).vs_format_type;
l_temp_sql:= ' SELECT ' ||
'''' || p_kf_grp_seg_tab(i).appl_short_name ||''''||' appl_short_name,' ||
'''' || p_kf_grp_seg_tab(i).flex_code ||''''||' flex_code,' ||
'''' || p_kf_grp_seg_tab(i).structure_code ||''''||' structure_code,' ||
'''' || p_kf_grp_seg_tab(i).segment_name ||''''||' segment_name,' ||
'''' || p_kf_grp_seg_tab(i).column_name ||''''||' column_name,' ||
'''' || p_kf_grp_seg_tab(i).segment_number ||''''||' segment_number,' ||
'''' || p_kf_grp_seg_tab(i).value_set ||''''||' value_set,' ||
'''' || p_kf_grp_seg_tab(i).lov_prompt ||''''||' lov_prompt,' ||
'''' || p_kf_grp_seg_tab(i).segment_type ||''''||' segment_type,' ||
'''' || p_kf_grp_seg_tab(i).window_prompt ||''''||' window_prompt,' ||
'''' || l_required ||''''||' required,' ||
'''' || l_display ||''''||' display,' ||
'''' || l_enabled ||''''||' enabled, ' ||
'''' || l_vs_validation_type ||''''||' vs_validation_type, ' ||
'''' || p_kf_grp_seg_tab(i).vs_description ||''''||' vs_description,' ||
'''' || l_vs_security_available ||''''||' vs_security_available,' ||
'''' || l_vs_enable_longlist ||''''||' vs_list_type,' || --List type
'''' || l_vs_format_type ||''''||' vs_format_type,' || --validation type
'''' || p_kf_grp_seg_tab(i).vs_maximum_size ||''''||' vs_maximum_size,' ||
'''' || p_kf_grp_seg_tab(i).vs_precision ||''''||' vs_precision,' ||
'''' || p_kf_grp_seg_tab(i).vs_numbers_only ||''''||' vs_numbers_only,' ||
'''' || p_kf_grp_seg_tab(i).vs_uppercase_only ||''''||' vs_uppercase_only,' ||
'''' || p_kf_grp_seg_tab(i).vs_right_justify_zero_fill ||''''||' vs_right_justify_zero_fill,' ||
'''' || p_kf_grp_seg_tab(i).vs_min_value ||''''||' vs_min_value,' ||
'''' || p_kf_grp_seg_tab(i).vs_max_value ||''''||' vs_max_value,' ||
'''' || p_kf_grp_seg_tab(i).vs_value_set_name ||''''||' value_set_name' ||
' FROM DUAL UNION';
select meaning into l_vs_security_available from hr_lookups where lookup_type = 'YES_NO' and lookup_code = p_kf_cmp_seg_tab(i).vs_security_available;
select meaning into l_vs_enable_longlist from fnd_lookups where lookup_type = 'FLEX_VALUESET_LONGLIST_FLAG' and lookup_code = p_kf_cmp_seg_tab(i).vs_enable_longlist;
select meaning into l_vs_format_type from fnd_lookups where lookup_type = 'FIELD_TYPE' and lookup_code = p_kf_cmp_seg_tab(i).vs_format_type;
l_temp_sql:= ' SELECT ' ||
'''' || p_kf_cmp_seg_tab(i).appl_short_name ||''''||' appl_short_name,' ||
'''' || p_kf_cmp_seg_tab(i).flex_code ||''''||' flex_code,' ||
'''' || p_kf_cmp_seg_tab(i).structure_code ||''''||' structure_code,' ||
'''' || p_kf_cmp_seg_tab(i).segment_name ||''''||' segment_name,' ||
'''' || p_kf_cmp_seg_tab(i).column_name ||''''||' column_name,' ||
'''' || p_kf_cmp_seg_tab(i).segment_number ||''''||' segment_number,' ||
'''' || p_kf_cmp_seg_tab(i).value_set ||''''||' value_set,' ||
'''' || p_kf_cmp_seg_tab(i).lov_prompt ||''''||' lov_prompt,' ||
'''' || p_kf_cmp_seg_tab(i).segment_type ||''''||' segment_type,' ||
'''' || p_kf_cmp_seg_tab(i).window_prompt ||''''||' window_prompt,' ||
'''' || l_required ||''''||' required,' ||
'''' || l_display ||''''||' display,' ||
'''' || l_enabled ||''''||' enabled, ' ||
'''' || l_vs_validation_type ||''''||' vs_validation_type, ' ||
'''' || p_kf_cmp_seg_tab(i).vs_description ||''''||' vs_description, ' ||
'''' || l_vs_security_available ||''''||' vs_security_available,' ||
'''' || l_vs_enable_longlist ||''''||' vs_list_type,' || --List type
'''' || l_vs_format_type ||''''||' vs_format_type,' || --validation type
'''' || p_kf_cmp_seg_tab(i).vs_maximum_size ||''''||' vs_maximum_size,' ||
'''' || p_kf_cmp_seg_tab(i).vs_precision ||''''||' vs_precision,' ||
'''' || p_kf_cmp_seg_tab(i).vs_numbers_only ||''''||' vs_numbers_only,' ||
'''' || p_kf_cmp_seg_tab(i).vs_uppercase_only ||''''||' vs_uppercase_only,' ||
'''' || p_kf_cmp_seg_tab(i).vs_right_justify_zero_fill ||''''||' vs_right_justify_zero_fill,' ||
'''' || p_kf_cmp_seg_tab(i).vs_min_value ||''''||' vs_min_value,' ||
'''' || p_kf_cmp_seg_tab(i).vs_max_value ||''''||' vs_max_value,' ||
'''' || p_kf_cmp_seg_tab(i).vs_value_set_name ||''''||' value_set_name' ||
' FROM DUAL UNION';
select meaning into l_vs_security_available from hr_lookups where lookup_type = 'YES_NO' and lookup_code = p_kf_cost_seg_tab(i).vs_security_available;
select meaning into l_vs_enable_longlist from fnd_lookups where lookup_type = 'FLEX_VALUESET_LONGLIST_FLAG' and lookup_code = p_kf_cost_seg_tab(i).vs_enable_longlist;
select meaning into l_vs_format_type from fnd_lookups where lookup_type = 'FIELD_TYPE' and lookup_code = p_kf_cost_seg_tab(i).vs_format_type;
l_temp_sql:= ' SELECT ' ||
'''' || p_kf_cost_seg_tab(i).appl_short_name ||''''||' appl_short_name,' ||
'''' || p_kf_cost_seg_tab(i).flex_code ||''''||' flex_code,' ||
'''' || p_kf_cost_seg_tab(i).structure_code ||''''||' structure_code,' ||
'''' || p_kf_cost_seg_tab(i).segment_name ||''''||' segment_name,' ||
'''' || p_kf_cost_seg_tab(i).column_name ||''''||' column_name,' ||
'''' || p_kf_cost_seg_tab(i).segment_number ||''''||' segment_number,' ||
'''' || p_kf_cost_seg_tab(i).value_set ||''''||' value_set,' ||
'''' || p_kf_cost_seg_tab(i).lov_prompt ||''''||' lov_prompt,' ||
'''' || p_kf_cost_seg_tab(i).segment_type ||''''||' segment_type,' ||
'''' || p_kf_cost_seg_tab(i).window_prompt ||''''||' window_prompt,' ||
'''' || l_required ||''''||' required,' ||
'''' || l_display ||''''||' display,' ||
'''' || l_enabled ||''''||' enabled, ' ||
'''' || l_vs_validation_type ||''''||' vs_validation_type, ' ||
'''' || p_kf_cost_seg_tab(i).vs_description ||''''||' vs_description,' ||
'''' || l_vs_security_available ||''''||' vs_security_available,' ||
'''' || l_vs_enable_longlist ||''''||' vs_list_type,' || --List type
'''' || l_vs_format_type ||''''||' vs_format_type,' || --validation type
'''' || p_kf_cost_seg_tab(i).vs_maximum_size ||''''||' vs_maximum_size,' ||
'''' || p_kf_cost_seg_tab(i).vs_precision ||''''||' vs_precision,' ||
'''' || p_kf_cost_seg_tab(i).vs_numbers_only ||''''||' vs_numbers_only,' ||
'''' || p_kf_cost_seg_tab(i).vs_uppercase_only ||''''||' vs_uppercase_only,' ||
'''' || p_kf_cost_seg_tab(i).vs_right_justify_zero_fill ||''''||' vs_right_justify_zero_fill,' ||
'''' || p_kf_cost_seg_tab(i).vs_min_value ||''''||' vs_min_value,' ||
'''' || p_kf_cost_seg_tab(i).vs_max_value ||''''||' vs_max_value,' ||
'''' || p_kf_cost_seg_tab(i).vs_value_set_name ||''''||' value_set_name' ||
' FROM DUAL UNION';
l_structure_tab.delete;
l_segment_tab.delete;
l_structure_tab.delete;
l_segment_tab.delete;
l_structure_tab.delete;
l_segment_tab.delete;
l_structure_tab.delete;
l_segment_tab.delete;
l_structure_tab.delete;
l_segment_tab.delete;
l_structure_tab.delete;
l_segment_tab.delete;
l_structure_tab.delete;
l_segment_tab.delete;
l_structure_tab.delete;
l_segment_tab.delete;
l_structure_tab.delete;
l_segment_tab.delete;
l_structure_tab.delete;
l_segment_tab.delete;
l_structure_tab.delete;
l_segment_tab.delete;
l_structure_tab.delete;
l_segment_tab.delete;
--insert into temp(data) values (l_str_seg_append_clob_for_pv);
select meaning into l_allow_dynamic from hr_lookups where lookup_type = 'YES_NO' and lookup_code = 'Y';
select meaning into l_vs_validation_type from fnd_lookups where lookup_type = 'SEG_VAL_TYPES' and lookup_code = 'I';
select application_name into l_appl_name from fnd_application_vl where application_short_name = p_kf_structure_tab(j).appl_short_name;
form_xml('CS','ALLOW_DYNAMIC_INSERTS','') ||
form_xml('D','',l_allow_dynamic)||
form_xml('CE','ALLOW_DYNAMIC_INSERTS','');
select meaning into l_vs_security_available from hr_lookups where lookup_type = 'YES_NO' and lookup_code = p_kf_segment_tab(i).vs_security_available;
select meaning into l_vs_enable_longlist from fnd_lookups where lookup_type = 'FLEX_VALUESET_LONGLIST_FLAG' and lookup_code = p_kf_segment_tab(i).vs_enable_longlist;
select meaning into l_vs_format_type from fnd_lookups where lookup_type = 'FIELD_TYPE' and lookup_code = p_kf_segment_tab(i).vs_format_type;
l_prejoin_sql := ' select terr.TERRITORY_SHORT_NAME Legislation , curr.name Currency, A.Tax_Start_Date, '
||' lookup.meaning Install_Tax_Unit_Val '
||' from ( ';
l_temp_sql:= ' SELECT ' ||
'''' || p_int_hrms_setup_tab(i).legislation_code ||''''||' legislation_code,' ||
'''' || p_int_hrms_setup_tab(i).currency_code ||''''||' currency_code,' ||
'''' || p_int_hrms_setup_tab(i).tax_start_date ||''''||' tax_start_date,' ||
'''' || p_int_hrms_setup_tab(i).install_tax_unit ||''''||' install_tax_unit' ||
' FROM DUAL UNION';
l_temp_sql:= ' SELECT ' ||
'''' || p_security_profile_tab(i).security_group_name ||''''||' security_group_name, ' ||
'''' || p_security_profile_tab(i).business_group_name ||''''||' business_group_name, ' ||
'''' ||l_option ||''''||' Employees, ' ||
'''' ||l_option ||''''||' Contingent_Workers, ' ||
'''' ||l_option ||''''||' Applicants, ' ||
'''' ||l_option ||''''||' Contact ' ||
' FROM DUAL UNION';
l_temp_sql:= ' SELECT ' ||
'''' || p_org_hierarchy_tab(i).name ||''''||' name , ' ||
'''' || p_org_hierarchy_tab(i).org_structure_version_id ||''''||' org_structure_version_id ' ||
' FROM DUAL UNION';
l_temp_sql:= ' SELECT ' ||
'''' || p_org_hierarchy_ele_oc_tab(i).org_structure_version_id ||''''||' org_structure_version_id,'||
'''' || REPLACE ( p_org_hierarchy_ele_oc_tab(i).parent_organization_name , '''', '''''') ||''''||' parent_organization_name,'||
'''' || REPLACE (p_org_hierarchy_ele_oc_tab(i).child_organization_name, '''', '''''') ||''''||' child_organization_name '||
' FROM DUAL UNION';
l_temp_sql:= ' SELECT ' ||
'''' || p_org_hierarchy_ele_le_tab(i).org_structure_version_id ||''''||' org_structure_version_id,'||
'''' || REPLACE ( p_org_hierarchy_ele_le_tab(i).parent_organization_name , '''', '''''') ||''''||' parent_organization_name,'||
'''' || REPLACE ( p_org_hierarchy_ele_le_tab(i).child_organization_name, '''','''''') ||''''||' child_organization_name '||
' FROM DUAL UNION';
l_parent_org_name := ' SELECT ' ||
'''' || REPLACE ( p_org_hierarchy_ele_oc_tab(0).parent_organization_name , '''', '''''') ||''''||' parent_organization_name';
l_prejoin_sql := ' select decode(A.legislation_code,''BF'',''International'',terr.TERRITORY_SHORT_NAME) Legislation , '
||' fapp.application_name '
||' from ( ';
l_temp_sql:= ' SELECT ' ||
'''' || p_post_install_tab(i).legislation_code ||''''||' legislation_code,' ||
'''' || p_post_install_tab(i).applicaton_short_name ||''''||' application_short_name ' ||
' FROM DUAL UNION';
SELECT tag INTO l_encoding_tag
FROM fnd_lookup_values
WHERE lookup_type = 'FND_ISO_CHARACTER_SET_MAP'
AND lookup_code = SUBSTR(USERENV('LANGUAGE'),
INSTR(USERENV('LANGUAGE'), '.') + 1)
AND language = 'US';