The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT pdb.defined_balance_id def_bal
FROM pay_defined_balances pdb,
pay_balance_dimensions pbd,
pay_balance_types pbt
WHERE pbt.balance_type_id = pdb.balance_type_id
AND pbd.balance_dimension_id = pdb.balance_dimension_id
AND pbd.database_item_suffix = c_data_suffix
AND pbt.balance_name = c_bal_name
AND nvl(pdb.legislation_code,'MX') = 'MX';
SELECT max(paa.assignment_action_id)
FROM pay_consolidation_sets pcs,
pay_payroll_actions ppa,
pay_assignment_actions paa
WHERE pcs.business_group_id = c_business_group_id
AND ppa.payroll_action_id = paa.payroll_action_id
AND ppa.consolidation_set_id = pcs.consolidation_set_id + 0
AND paa.tax_unit_id = c_tax_unit_id
AND ppa.business_group_id+0 = c_business_group_id
AND ppa.action_type IN ('R', 'Q', 'B', 'V', 'I')
AND paa.action_status = 'C'
AND ppa.effective_date BETWEEN c_start_date_earned
AND c_end_date_earned;
SELECT meaning
FROM hr_lookups
WHERE lookup_type = 'YES_NO'
AND lookup_code = c_lookup_value ;
SELECT decode(c_value,'CTD', ffv.description,
substr( ffv.description,
instr(ffv.DESCRIPTION,'Period Date Range AND ')+
length('Period Date Range AND ') ))
FROM fnd_flex_values_vl ffv,
fnd_flex_value_sets ffs
WHERE ffs.flex_value_set_name = 'PAY_MX_TRR_DIMENSION'
AND ffv.flex_value_set_id = ffs.flex_value_set_id
AND ffv.flex_value = c_value ;
Name : insert_xml_plsql_table
Purpose : Procedure for inserting data intO the PL/SQL table
*****************************************************************************/
PROCEDURE insert_xml_plsql_table( p_xml_data IN OUT NOCOPY xml_data,
p_tag_name IN VARCHAR2,
p_tag_value IN VARCHAR2,
p_tag_type IN CHAR,
p_tag_value_type IN CHAR) IS
BEGIN
l_counter:= p_xml_data.count + 1 ;
END insert_xml_plsql_table;
SELECT hoi.org_information1 legal_employer_name,
hoi.org_information2 RFC_ID
FROM hr_organization_units hou,
hr_organization_information hoi
WHERE hoi.organization_id = hou.organization_id
AND hoi.org_information_context = 'MX_TAX_REGISTRATION'
AND hoi.organization_id = p_legal_employer_id ;
SELECT hou.name GRE_Name,
hoi.org_information1 ss_id
FROM hr_organization_units hou,
hr_organization_information hoi
WHERE hou.organization_id = hoi.organization_id
AND hoi.org_information_context = 'MX_SOC_SEC_DETAILS'
AND hoi.organization_id = p_gre_id;
SELECT pay_ac_utility.get_balance_name(pbt.balance_type_id) balance_name
,pay_ac_utility.get_bal_reporting_name(pbt.balance_type_id) rep_name
FROM pay_balance_types pbt,
pay_defined_balances pdb,
pay_balance_attributes pba,
pay_bal_attribute_definitions pbad
WHERE pbad.attribute_name LIKE 'Tax Remittance%'
AND pbad.business_group_id IS NULL
AND pbad.legislation_code = 'MX'
AND pba.attribute_id = pbad.attribute_id
AND pdb.defined_balance_id = pba.defined_balance_id
AND pdb.balance_type_id = pbt.balance_type_id
AND pdb.balance_type_id = pbt.balance_type_id
AND RTRIM(SUBSTR(pbad.attribute_name,
INSTR(pbad.attribute_name,'Tax Remittance for ')+
LENGTH('Tax Remittance for '))) =
NVL(p_state, RTRIM(substr(pbad.attribute_name,
INSTR(pbad.attribute_name,'Tax Remittance for ')+
LENGTH('Tax Remittance for '))));
SELECT pbt.balance_name,
pbt.reporting_name,
rtrim(substr(pbt.balance_name,1,
(length(pbt.balance_name)-3))) bal_name,
rtrim(substr(pbt.balance_name,
length(pbt.balance_name)-1)) ee_or_er,
pli.legislation_info4 soc_sec_tax_pct_ee,
pli.legislation_info5 soc_sec_tax_pct_er
FROM pay_balance_types pbt,
pay_defined_balances pdb,
pay_balance_attributes pba,
pay_bal_attribute_definitions pbad,
pay_mx_legislation_info_f pli,
fnd_lookup_values hrl
WHERE pbad.attribute_name LIKE 'Social Security Quota%'
AND pbad.business_group_id IS NULL
AND pbad.legislation_code = 'MX'
AND pbt.business_group_id IS NULL
AND pbt.legislation_code = 'MX'
AND pba.attribute_id = pbad.attribute_id
AND pdb.defined_balance_id = pba.defined_balance_id
AND pdb.balance_type_id = pbt.balance_type_id
AND hrl.lookup_type = 'MX_INSURANCE_TYPES'
AND hrl.language = 'US'
AND pli.legislation_info_type = 'MX Social Security Information'
AND pli.legislation_info1 = hrl.lookup_code
AND hrl.meaning = substr(pbt.balance_name, 1,
(length(pbt.balance_name)-3))
AND p_effective_date BETWEEN pli.effective_start_date
AND pli.effective_end_date
AND p_effective_date BETWEEN hrl.start_date_active
AND nvl(hrl.end_date_active,
TO_DATE('12/31/4712', 'MM/DD/YYYY'))
ORDER BY to_number(pli.legislation_info6);
SELECT DISTINCT pmx.state state_code,
pmx.state_name state_name
FROM per_mx_gres_legal_employer_v pmx
WHERE pmx.business_group_id = p_business_group_id
AND pmx.legal_employer_id = p_legal_employer_id
AND pmx.legal_employer_id = p_legal_employer_id
AND (( p_state_code IS NULL ) OR ( p_state_code IS NOT NULL and
p_state_code = pmx.state))
AND (( p_gre_id IS NULL ) OR ( p_gre_id IS NOT NULL and
p_gre_id = pmx.tax_unit_id));
SELECT pmx.tax_unit_id tax_unit_id,
pmx.gre_name gre_name,
pmx.ss_id
FROM per_mx_gres_legal_employer_v pmx
WHERE pmx.business_group_id = p_business_group_id
AND pmx.legal_employer_id = p_legal_employer_id
AND (( p_state IS NULL ) OR ( p_state IS NOT NULL and
p_state = pmx.state))
AND (( p_gre_id IS NULL ) OR ( p_gre_id IS NOT NULL and
p_gre_id = pmx.tax_unit_id));
SELECT fcl.meaning
FROM fnd_common_lookups fcl
WHERE fcl.lookup_type='MX_STATE'
AND fcl.lookup_code=p_state_code ;
insert_xml_plsql_table( p_xml_data,'TRR',NULL,'T','C');
dbg('Insert parameters to plsql table ');
/* insert parameter records IN pl/sql table */
insert_xml_plsql_table( p_xml_data,'START_DATE_EARNED',
to_char(p_start_date_earned,'DD-MON-YYYY'),'D','C');
insert_xml_plsql_table( p_xml_data,'END_DATE_EARNED',
to_char(p_end_date_earned,'DD-MON-YYYY'),'D','C');
insert_xml_plsql_table( p_xml_data,'LEGAL_EMPLOYER_NAME',
l_legal_employer_name,'D','C');
insert_xml_plsql_table( p_xml_data,'GRE_PARAMETER',l_gre_param,'D','C');
insert_xml_plsql_table( p_xml_data,'STATE_PARAMETER',l_st_name,'D','C');
insert_xml_plsql_table( p_xml_data,'SHOW_FEDERAL',
get_yesno_value(p_show_isr),'D','C');
insert_xml_plsql_table( p_xml_data,'SHOW_SOCIAL_SECURITY',
get_yesno_value(p_show_soc_security),'D','C');
insert_xml_plsql_table( p_xml_data,'SHOW_STATE',
get_yesno_value(p_show_state),'D','C');
insert_xml_plsql_table( p_xml_data,'DIMENSION',
get_dimension_desc(p_dimension),'D','C');
insert_xml_plsql_table(p_xml_data,'RFC_ID',l_RFC_code,'D','C');
insert_xml_plsql_table( p_xml_data,'SHOW_DIMENSION','No','D','C');
insert_xml_plsql_table( p_xml_data,'SHOW_DIMENSION','Yes','D','C');
insert_xml_plsql_table( p_xml_data,'STATE',NULL,'T','C');
insert_xml_plsql_table( p_xml_data,'STATE_NAME',l_state_name,'D','C');
state_earnings.delete ;
insert_xml_plsql_table( p_xml_data,'SHOW_STATE_DETAILS_FLAG',
'Yes','D','C');
insert_xml_plsql_table( p_xml_data,'SHOW_STATE_DETAILS_FLAG',
'No','D','C');
insert_xml_plsql_table( p_xml_data,'GRE',NULL,'T','C');
insert_xml_plsql_table( p_xml_data,'GRE_NAME',l_gre_name,'D','C');
insert_xml_plsql_table( p_xml_data,'SOCIAL_SECURITY_ID',l_ss_id,
'D','C');
insert_xml_plsql_table( p_xml_data,'GROSS_EARNINGS',NULL,'T','C');
insert_xml_plsql_table( p_xml_data,'GROSS_SUBJ_CTD',l_gross_subj_ctd,
'D','B');
insert_xml_plsql_table( p_xml_data,'GROSS_SUBJ_DTD',
l_gross_subj_dtd,'D','B');
insert_xml_plsql_table( p_xml_data,'/GROSS_EARNINGS',NULL,'T','C');
insert_xml_plsql_table( p_xml_data,'ISR',NULL,'T','C');
insert_xml_plsql_table( p_xml_data,'ISR_WITHHELD_CTD',
l_isr_witheld_ctd,'D','B');
insert_xml_plsql_table( p_xml_data,'ISR_SUBJ_CTD',l_isr_subj_ctd,
'D','B');
insert_xml_plsql_table( p_xml_data,'ISR_WITHHELD_DTD',
l_isr_witheld_dtd,'D','B');
insert_xml_plsql_table( p_xml_data,'ISR_SUBJ_DTD',
l_isr_subj_dtd,'D','B');
insert_xml_plsql_table( p_xml_data,'/ISR',NULL,'T','C');
insert_xml_plsql_table( p_xml_data,'SOCIAL_SECURITY',NULL,'T','C');
insert_xml_plsql_table( p_xml_data,'SOC_SEC_EE_CTD',
l_soc_sec_ee_ctd,'D','B');
insert_xml_plsql_table( p_xml_data,'SOC_SEC_ER_CTD',
l_soc_sec_er_ctd,'D','B');
insert_xml_plsql_table( p_xml_data,'SOC_SEC_TOTAL_CTD',
l_soc_sec_tot_ctd,'D','B');
insert_xml_plsql_table( p_xml_data,'SOC_SEC_EE_DTD',
l_soc_sec_ee_dtd,'D','B');
insert_xml_plsql_table( p_xml_data,'SOC_SEC_ER_DTD',
l_soc_sec_er_dtd,'D','B');
insert_xml_plsql_table( p_xml_data,'SOC_SEC_TOTAL_DTD',
l_soc_sec_tot_dtd,'D','B');
insert_xml_plsql_table(p_xml_data,'/SOCIAL_SECURITY',NULL,'T','C');
insert_xml_plsql_table( p_xml_data,'STATE_TAX',NULL,'T','C');
insert_xml_plsql_table( p_xml_data,'STATE_WITHHELD_CTD',
l_st_witheld_ctd,'D','B');
insert_xml_plsql_table( p_xml_data,'STATE_SUBJ_CTD',
l_st_subj_ctd,'D','B');
insert_xml_plsql_table( p_xml_data,'STATE_WITHHELD_DTD',
l_st_witheld_dtd,'D','B');
insert_xml_plsql_table( p_xml_data,'STATE_SUBJ_DTD',
l_st_subj_dtd,'D','B');
insert_xml_plsql_table( p_xml_data,'/STATE_TAX',NULL,'T','C');
insert_xml_plsql_table( p_xml_data,'STATE_DETAILS',NULL,'T','C');
insert_xml_plsql_table( p_xml_data,'STATE_DETAILS_NAME',
state_earnings(l_cnt50).balance_name,'D','C');
insert_xml_plsql_table( p_xml_data,'STATE_DETAILS_SUBJ_CTD',
l_st_earn_ctd_value,'D','B');
insert_xml_plsql_table( p_xml_data,'STATE_DETAILS_SUBJ_DTD',
l_st_earn_dtd_value,'D','B');
insert_xml_plsql_table( p_xml_data,'/STATE_DETAILS',NULL,'T','C');
insert_xml_plsql_table( p_xml_data,'SOCIAL_SECURITY_QUOTA',
NULL,'T','C');
insert_xml_plsql_table( p_xml_data,'SOC_SEC_INS',
soc_sec_det_tab(l_cnt5).balance_name,'D','C');
insert_xml_plsql_table( p_xml_data,'SOC_SEC_INS_EE_PCT',
soc_sec_det_tab(l_cnt5).soc_sec_tax_pct_ee,'D','P');
insert_xml_plsql_table( p_xml_data,'SOC_SEC_INS_ER_PCT',
hr_mx_utility.get_wrip(p_business_group_id,
l_tax_unit_id),'D','P');
insert_xml_plsql_table( p_xml_data,'SOC_SEC_INS_ER_PCT',
soc_sec_det_tab(l_cnt5).soc_sec_tax_pct_er,'D','P');
insert_xml_plsql_table( p_xml_data,'SOC_SEC_INS_EE_CTD',
soc_sec_det_tab(l_cnt5).soc_sec_quo_ee_ctd,'D','B');
insert_xml_plsql_table( p_xml_data,'SOC_SEC_INS_ER_CTD',
soc_sec_det_tab(l_cnt5).soc_sec_quo_er_ctd,'D','B');
insert_xml_plsql_table( p_xml_data,'SOC_SEC_INS_EE_DTD',
soc_sec_det_tab(l_cnt5).soc_sec_quo_ee_dtd,'D','B');
insert_xml_plsql_table( p_xml_data,'SOC_SEC_INS_ER_DTD',
soc_sec_det_tab(l_cnt5).soc_sec_quo_er_dtd,'D','B');
insert_xml_plsql_table( p_xml_data,'/SOCIAL_SECURITY_QUOTA',
NULL,'T','C');
insert_xml_plsql_table( p_xml_data,'/GRE',NULL,'T','C');
insert_xml_plsql_table( p_xml_data,'STATE_TOTAL',NULL,'T','C');
insert_xml_plsql_table( p_xml_data,'STATE_TOTAL_HEAD',l_state_heading,
'D','C');
insert_xml_plsql_table( p_xml_data,'ST_GROSS',NULL,'T','C');
insert_xml_plsql_table( p_xml_data,'ST_GROSS_SUBJ_CTD',l_st_gross_sub_ctd,
'D','B');
insert_xml_plsql_table( p_xml_data,'ST_GROSS_SUBJ_DTD',
l_st_gross_sub_dtd,'D','B');
insert_xml_plsql_table( p_xml_data,'/ST_GROSS',NULL,'T','C');
insert_xml_plsql_table( p_xml_data,'ST_ISR',NULL,'T','C');
insert_xml_plsql_table( p_xml_data,'ST_ISR_WITHHELD_CTD',
l_st_isr_witheld_ctd,'D','B');
insert_xml_plsql_table( p_xml_data,'ST_ISR_SUBJ_CTD',
l_st_isr_subj_ctd,'D','B');
insert_xml_plsql_table( p_xml_data,'ST_ISR_WITHHELD_DTD',
l_st_isr_witheld_dtd,'D','B');
insert_xml_plsql_table( p_xml_data,'ST_ISR_SUBJ_DTD',
l_st_isr_subj_dtd,'D','B');
insert_xml_plsql_table( p_xml_data,'/ST_ISR',NULL,'T','C');
insert_xml_plsql_table( p_xml_data,'ST_SOCIAL_SECURITY',NULL,'T','C');
insert_xml_plsql_table( p_xml_data,'ST_SOC_SEC_EE_CTD',
l_st_soc_sec_ee_ctd,'D','B');
insert_xml_plsql_table( p_xml_data,'ST_SOC_SEC_ER_CTD',
l_st_soc_sec_er_ctd,'D','B');
insert_xml_plsql_table( p_xml_data,'ST_SOC_SEC_TOTAL_CTD',
l_st_soc_sec_tot_ctd,'D','B');
insert_xml_plsql_table( p_xml_data,'ST_SOC_SEC_EE_DTD',
l_st_soc_sec_ee_dtd,'D','B');
insert_xml_plsql_table( p_xml_data,'ST_SOC_SEC_ER_DTD',
l_st_soc_sec_er_dtd,'D','B');
insert_xml_plsql_table( p_xml_data,'ST_SOC_SEC_TOTAL_DTD',
l_st_soc_sec_tot_dtd,'D','B');
insert_xml_plsql_table( p_xml_data,'/ST_SOCIAL_SECURITY',NULL,'T','C');
insert_xml_plsql_table( p_xml_data,'ST_STATE_TAX',NULL,'T','C');
insert_xml_plsql_table( p_xml_data,'ST_STATE_WITHHELD_CTD',
l_st_st_witheld_ctd,'D','B');
insert_xml_plsql_table( p_xml_data,'ST_STATE_SUBJ_CTD',
l_st_st_subj_ctd,'D','B');
insert_xml_plsql_table( p_xml_data,'ST_STATE_WITHHELD_DTD',
l_st_st_witheld_dtd,'D','B');
insert_xml_plsql_table( p_xml_data,'ST_STATE_SUBJ_DTD',
l_st_st_subj_dtd,'D','B');
insert_xml_plsql_table( p_xml_data,'/ST_STATE_TAX',NULL,'T','C');
insert_xml_plsql_table( p_xml_data,'ST_STATE_DETAILS',NULL,'T','C');
insert_xml_plsql_table( p_xml_data,'ST_STATE_DETAILS_NAME',
st_state_earnings(m).balance_name,'D','C');
insert_xml_plsql_table( p_xml_data,'ST_STATE_DETAILS_SUBJ_CTD',
st_state_earnings(m).state_earnings_ctd_value,'D','B');
insert_xml_plsql_table( p_xml_data,'ST_STATE_DETAILS_SUBJ_DTD',
st_state_earnings(m).state_earnings_dtd_value,'D','B');
insert_xml_plsql_table(p_xml_data,'/ST_STATE_DETAILS',NULL,'T','C');
insert_xml_plsql_table( p_xml_data,'ST_SOCIAL_SECURITY_QUOTA',NULL,
'T','C');
insert_xml_plsql_table( p_xml_data,'ST_SOC_SEC_INS',
st_soc_sec_det_tab(m).balance_name,'D','C');
insert_xml_plsql_table( p_xml_data,'ST_SOC_SEC_INS_EE_CTD',
st_soc_sec_det_tab(m).soc_sec_quo_ee_ctd,
'D','B');
insert_xml_plsql_table( p_xml_data,'ST_SOC_SEC_INS_ER_CTD',
st_soc_sec_det_tab(m).soc_sec_quo_er_ctd,
'D','B');
insert_xml_plsql_table( p_xml_data,'ST_SOC_SEC_INS_EE_DTD',
st_soc_sec_det_tab(m).soc_sec_quo_ee_dtd,
'D','B');
insert_xml_plsql_table( p_xml_data,'ST_SOC_SEC_INS_ER_DTD',
st_soc_sec_det_tab(m).soc_sec_quo_er_dtd,
'D','B');
insert_xml_plsql_table( p_xml_data,'/ST_SOCIAL_SECURITY_QUOTA',
NULL,'T','C');
insert_xml_plsql_table( p_xml_data,'/STATE_TOTAL',NULL,'T','C');
insert_xml_plsql_table( p_xml_data,'/STATE',NULL,'T','C');
insert_xml_plsql_table( p_xml_data,'LEGAL_EMPLOYER_TOTAL',NULL,'T','C');
insert_xml_plsql_table( p_xml_data,'LE_TOTAL_HEAD',
'Legal Employer Total Report','D','C');
insert_xml_plsql_table( p_xml_data,'LE_GROSS',NULL,'T','C');
insert_xml_plsql_table( p_xml_data,'LE_GROSS_SUBJ_CTD',
l_lt_gross_sub_ctd,'D','B');
insert_xml_plsql_table( p_xml_data,'LE_GROSS_SUBJ_DTD',
l_lt_gross_sub_dtd,'D','B');
insert_xml_plsql_table( p_xml_data,'/LE_GROSS',NULL,'T','C');
insert_xml_plsql_table( p_xml_data,'LE_ISR',NULL,'T','C');
insert_xml_plsql_table( p_xml_data,'LE_ISR_WITHHELD_CTD',
l_lt_isr_witheld_ctd,'D','B');
insert_xml_plsql_table( p_xml_data,'LE_ISR_SUBJ_CTD',
l_lt_isr_subj_ctd,'D','B');
insert_xml_plsql_table( p_xml_data,'LE_ISR_WITHHELD_DTD',
l_lt_isr_witheld_dtd,'D','B');
insert_xml_plsql_table( p_xml_data,'LE_ISR_SUBJ_DTD',
l_lt_isr_subj_dtd,'D','B');
insert_xml_plsql_table( p_xml_data,'/LE_ISR',NULL,'T','C');
insert_xml_plsql_table( p_xml_data,'LE_SOCIAL_SECURITY',NULL,'T','C');
insert_xml_plsql_table( p_xml_data,'LE_SOC_SEC_EE_CTD',
l_lt_soc_sec_ee_ctd,'D','B');
insert_xml_plsql_table( p_xml_data,'LE_SOC_SEC_ER_CTD',
l_lt_soc_sec_er_ctd,'D','B');
insert_xml_plsql_table( p_xml_data,'LE_SOC_SEC_TOTAL_CTD',
l_lt_soc_sec_tot_ctd,'D','B');
insert_xml_plsql_table( p_xml_data,'LE_SOC_SEC_EE_DTD',
l_lt_soc_sec_ee_dtd,'D','B');
insert_xml_plsql_table( p_xml_data,'LE_SOC_SEC_ER_DTD',
l_lt_soc_sec_er_dtd,'D','B');
insert_xml_plsql_table( p_xml_data,'LE_SOC_SEC_TOTAL_DTD',
l_lt_soc_sec_tot_dtd,'D','B');
insert_xml_plsql_table( p_xml_data,'/LE_SOCIAL_SECURITY',NULL,'T','C');
insert_xml_plsql_table( p_xml_data,'LE_STATE_TAX',NULL,'T','C');
insert_xml_plsql_table( p_xml_data,'LE_STATE_WITHHELD_CTD',
l_lt_st_witheld_ctd,'D','B');
insert_xml_plsql_table( p_xml_data,'LE_STATE_SUBJ_CTD',
l_lt_st_subj_ctd,'D','B');
insert_xml_plsql_table( p_xml_data,'LE_STATE_WITHHELD_DTD',
l_lt_st_witheld_dtd,'D','B');
insert_xml_plsql_table( p_xml_data,'LE_STATE_SUBJ_DTD',
l_lt_st_subj_dtd,'D','B');
insert_xml_plsql_table( p_xml_data,'/LE_STATE_TAX',NULL,'T','C');
insert_xml_plsql_table( p_xml_data,'LE_SOCIAL_SECURITY_QUOTA',
NULL,'T','C');
insert_xml_plsql_table( p_xml_data,'LE_SOC_SEC_INS',
le_soc_sec_det_tab(m).balance_name,'D','C');
insert_xml_plsql_table( p_xml_data,'LE_SOC_SEC_INS_EE_CTD',
le_soc_sec_det_tab(m).soc_sec_quo_ee_ctd,
'D','B');
insert_xml_plsql_table( p_xml_data,'LE_SOC_SEC_INS_ER_CTD',
le_soc_sec_det_tab(m).soc_sec_quo_er_ctd,
'D','B');
insert_xml_plsql_table( p_xml_data,'LE_SOC_SEC_INS_EE_DTD',
le_soc_sec_det_tab(m).soc_sec_quo_ee_dtd,
'D','B');
insert_xml_plsql_table( p_xml_data,'LE_SOC_SEC_INS_ER_DTD',
le_soc_sec_det_tab(m).soc_sec_quo_er_dtd,
'D','B');
insert_xml_plsql_table( p_xml_data,'/LE_SOCIAL_SECURITY_QUOTA',
NULL,'T','C');
insert_xml_plsql_table( p_xml_data,'/LEGAL_EMPLOYER_TOTAL',NULL,'T','C');
insert_xml_plsql_table( p_xml_data,'/TRR',NULL,'T','C');
insert into fnd_sessions
(session_id, effective_date)
SELECT userenv('sessionid'),fnd_date.canonical_to_date(p_session_date)
FROM sys.dual
WHERE not exists
(SELECT 1
FROM fnd_sessions fs
WHERE fs.session_id = userenv('sessionid')) ;
xml_data_table.delete;
SELECT XDO_CP_DATA_SECURITY_PKG.GET_CONCURRENT_REQUEST_IDS FROM DUAL;
select template_type_code from xdo_templates_vl where template_code = p_template and application_short_name = (select application_short_name from fnd_application_vl where application_id = 801);
SELECT FCP.APPLICATION_ID
FROM FND_CONCURRENT_PROGRAMS FCP,FND_CONCURRENT_REQUESTS R
WHERE FCP.CONCURRENT_PROGRAM_ID = R.CONCURRENT_PROGRAM_ID AND
R.REQUEST_ID = :$FLEX$.XDO_REPORT_REQUEST_ID
*/
IF l_req_id > 0 AND l_dev_phase ='COMPLETE' THEN
dbg('Submitting XML Report Publisher concurrent request');