The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT
template_id,
template_type,
template_name,
base_processing_priority,
business_group_id,
legislation_code,
version_number,
base_name,
max_base_name_length,
configuration_info_category,
configuration_information1,
configuration_information2,
configuration_information3,
configuration_information4,
configuration_information5,
configuration_information6,
configuration_information7,
configuration_information8,
configuration_information9,
configuration_information10,
configuration_information11,
configuration_information12,
configuration_information13,
configuration_information14,
configuration_information15,
configuration_information16,
configuration_information17,
configuration_information18,
configuration_information19,
configuration_information20,
configuration_information21,
configuration_information22,
configuration_information23,
configuration_information24,
configuration_information25,
configuration_information26,
configuration_information27,
configuration_information28,
configuration_information29,
configuration_information30,
configuration_info_category,
configuration_information1,
configuration_information2,
configuration_information3,
configuration_information4,
configuration_information5,
configuration_information6,
configuration_information7,
configuration_information8,
configuration_information9,
configuration_information10,
configuration_information11,
configuration_information12,
configuration_information13,
configuration_information14,
configuration_information15,
configuration_information16,
configuration_information17,
configuration_information18,
configuration_information19,
configuration_information20,
configuration_information21,
configuration_information22,
configuration_information23,
configuration_information24,
configuration_information25,
configuration_information26,
configuration_information27,
configuration_information28,
configuration_information29,
configuration_information30,
object_version_number
FROM pay_element_templates
WHERE template_id = p_template_id
FOR UPDATE OF template_id;
SELECT 'Y', template_id
INTO l_template_exists, l_template_id
FROM pay_element_templates
WHERE template_type = pay_in_etw_struct.g_template_type
AND legislation_code = pay_in_etw_struct.g_legislation_code
AND template_name = p_template_name;
DELETE FROM pay_ele_tmplt_class_usages
WHERE template_id = l_template_id;
pay_element_template_api.delete_user_structure(FALSE ,TRUE ,
l_template_id);
SELECT enabled_flag
INTO l_enabled_flag
FROM fnd_currencies
WHERE currency_code = pay_in_etw_struct.g_currency_code;
UPDATE fnd_currencies
SET enabled_flag = 'Y'
WHERE currency_code = pay_in_etw_struct.g_currency_code
AND enabled_flag <> 'Y';
SELECT formula_id, object_version_number
INTO l_template_rec.uf_setup.formula_id, l_object_version_number
FROM pay_shadow_formulas
WHERE template_type = pay_in_etw_struct.g_template_type
AND legislation_code= pay_in_etw_struct.g_legislation_code
AND formula_name = l_template_rec.uf_setup.formula_name;
SELECT formula_id, object_version_number
INTO l_template_rec.ae_setup(i).uf_setup.formula_id, l_object_version_number
FROM pay_shadow_formulas
WHERE template_type = pay_in_etw_struct.g_template_type
AND legislation_code= pay_in_etw_struct.g_legislation_code
AND formula_name = l_template_rec.ae_setup(i).uf_setup.formula_name;
UPDATE fnd_currencies
SET enabled_flag = l_enabled_flag
WHERE currency_code = pay_in_etw_struct.g_currency_code;
SELECT classification_id
INTO l_classification_id
FROM pay_element_classifications
WHERE legislation_code = pay_in_etw_struct.g_legislation_code
AND classification_name = p_classification;
SELECT count(*)
INTO l_exists
FROM pay_ele_tmplt_class_usages
WHERE classification_id = l_classification_id
AND template_id = p_template_id;
SELECT pay_ele_tmplt_class_usg_s.nextval
INTO l_ele_tmplt_class_id
FROM dual;
INSERT INTO pay_ele_tmplt_class_usages
( ele_template_classification_id
,classification_id
,template_id
,display_process_mode
,display_arrearage )
VALUES ( l_ele_tmplt_class_id
,l_classification_id
,p_template_id
,'Y'
,null);
PROCEDURE delete_template_association
(p_template_name IN VARCHAR2
,p_classification IN VARCHAR2 )
IS
l_procedure CONSTANT VARCHAR2(100):= g_package||'delete_template_association';
DELETE FROM pay_ele_tmplt_class_usages
WHERE ele_template_classification_id
IN (SELECT petcu.ele_template_classification_id
FROM pay_ele_tmplt_class_usages petcu
,pay_element_classifications pec
,pay_element_templates pet
WHERE petcu.classification_id = pec.classification_id
AND petcu.template_id = pet.template_id
AND pet.template_name = p_template_name
AND pec.classification_name = p_classification
AND pec.legislation_code = pay_in_etw_struct.g_legislation_code
AND pet.legislation_code = pay_in_etw_struct.g_legislation_code);
END delete_template_association;
SELECT pet.element_type_id
,pet.business_group_id
,pet.effective_start_date
,pet.object_version_number
,pec.classification_name
,pet.element_name
,pet.reporting_name
FROM pay_element_types_f pet
,pay_element_templates tmp
,pay_element_classifications pec
WHERE pet.element_name = tmp.base_name
AND tmp.template_id = p_template_id
AND pet.classification_id = pec.classification_id;
SELECT pet.element_type_id
,pet.object_version_number
FROM pay_element_types_f pet
,pay_element_classifications pec
WHERE pet.element_name = p_base_name || ' Paid MP'
AND pet.classification_id = pec.classification_id
AND pet.business_group_id = p_business_group_id
AND pec.classification_name = 'Paid Monetary Perquisite'
AND pec.legislation_code = 'IN';
SELECT catg.allowance_name
,catg.category_code
,exem.exemption_amount
FROM pay_in_allowance_categories_v catg
,pay_in_allowance_max_exem_v exem
WHERE catg.allowance_name = exem.allowance_name
AND catg.allowance_name = p_allowance_name;
SELECT pec.classification_name
FROM pay_sub_classification_rules_f pscr
,pay_element_classifications pec
WHERE pscr.classification_id = pec.classification_id
AND pec.parent_classification_id =
(SELECT classification_id FROM pay_element_classifications
WHERE classification_name = 'Perquisites'
AND legislation_code = 'IN')
AND element_type_id = p_element_id
AND p_effective_date BETWEEN pscr.effective_start_date
AND pscr.effective_end_date;
SELECT element_type_id, object_version_number
FROM pay_element_types_f
WHERE element_name = p_element_name || ' Paid MP'
AND business_group_id = p_business_group_id
AND p_effective_date BETWEEN effective_start_date AND effective_end_date;
SELECT DECODE(l_template.configuration_information2,
'Y','R',l_template.configuration_information2)
INTO l_exp_nature
FROM dual;
UPDATE pay_element_templates
SET configuration_information2 = 'N'
WHERE template_id = p_template_id;
pay_element_types_api.update_element_type
(
p_effective_date => l_element.effective_start_date
, p_datetrack_update_mode => hr_api.g_correction
, p_element_type_id => l_element.element_type_id
, p_object_version_number => l_element.object_version_number
, p_element_information_category => UPPER(pay_in_etw_struct.g_legislation_code||'_'||
l_element.classification_name)
, p_element_information1 => l_alwn_details.allowance_name
, p_element_information2 => l_alwn_details.category_code
, p_element_information3 => l_alwn_details.exemption_amount
, p_element_information4 => l_exp_nature
, p_effective_start_date => l_et_start_date
, p_effective_end_date => l_et_end_date
, p_comment_id => l_comment_id
, p_processing_priority_warning => l_priority_warn
, p_element_name_warning => l_name_warn
, p_element_name_change_warning => l_change_warn
);
-- Delete Balance Feeds
--
pay_in_utils.delete_balance_feeds
(p_balance_name => 'Taxable Allowances for Projection'
,p_element_name => l_element.element_name
,p_input_value_name => 'Standard Taxable Value'
,p_effective_date => l_element.effective_start_date
);
pay_in_utils.delete_balance_feeds
(p_balance_name => 'Taxable Allowances'
,p_element_name => l_element.element_name
,p_input_value_name => 'Taxable Value'
,p_effective_date => l_element.effective_start_date
);
-- Delete input values : Allowance Amount, Taxable Value, Standard Taxable Value
--
DELETE FROM pay_input_values_f
WHERE element_type_id = l_element.element_type_id
AND NAME IN ('Allowance Amount','Taxable Value','Standard Taxable Value')
AND l_element.effective_start_date BETWEEN effective_start_date AND effective_end_date;
pay_element_types_api.update_element_type
(
p_effective_date => l_element.effective_start_date
, p_datetrack_update_mode => hr_api.g_correction
, p_element_type_id => l_element.element_type_id
, p_object_version_number => l_element.object_version_number
, p_element_information_category => UPPER(pay_in_etw_struct.g_legislation_code||'_'||
l_element.classification_name)
, p_element_information1 => l_template.configuration_information1
, p_element_information6 => l_template.configuration_information3
, p_effective_start_date => l_et_start_date
, p_effective_end_date => l_et_end_date
, p_comment_id => l_comment_id
, p_processing_priority_warning => l_priority_warn
, p_element_name_warning => l_name_warn
, p_element_name_change_warning => l_change_warn
);
pay_element_types_api.delete_element_type
(p_validate => FALSE
,p_effective_date => l_element.effective_start_date
,p_datetrack_delete_mode => hr_api.g_zap
,p_element_type_id => l_ele_type_id
,p_object_version_number => l_object_version_number
,p_effective_start_date => l_effective_start_date
,p_effective_end_date => l_effective_end_date
,p_balance_feeds_warning => l_balance_feeds_warning
,p_processing_rules_warning => l_processing_rules_warning
);
SELECT element_type_id, object_version_number
INTO l_et_id, l_ovn
FROM pay_element_types_f
WHERE element_name = l_element.element_name || ' Paid MP'
AND business_group_id = l_element.business_group_id
AND l_element.effective_start_date between effective_start_date and effective_end_date;
pay_element_types_api.update_element_type
(
p_effective_date => l_element.effective_start_date
, p_datetrack_update_mode => hr_api.g_correction
, p_element_type_id => l_et_id
, p_object_version_number => l_ovn
, p_reporting_name => l_element.reporting_name || ' Paid MP'
, p_once_each_period_flag => 'N'
, p_effective_start_date => l_et_start_date
, p_effective_end_date => l_et_end_date
, p_comment_id => l_comment_id
, p_processing_priority_warning => l_priority_warn
, p_element_name_warning => l_name_warn
, p_element_name_change_warning => l_change_warn
);
SELECT flex_value_set_id
INTO l_flx_val_set_id
FROM fnd_flex_value_sets
WHERE flex_value_set_name = 'PER_IN_LTC_BLOCK';
UPDATE pay_input_values_f
SET value_set_id = l_flx_val_set_id
WHERE input_value_id = l_input_value_id
AND l_element.effective_start_date BETWEEN effective_start_date AND effective_end_date;
SELECT DECODE(l_ff_column,
'CONFIGURATION_INFORMATION2',l_template.configuration_information2,
'CONFIGURATION_INFORMATION3',l_template.configuration_information3,
'CONFIGURATION_INFORMATION4',l_template.configuration_information4,
'CONFIGURATION_INFORMATION5',l_template.configuration_information5,
'CONFIGURATION_INFORMATION6',l_template.configuration_information6,
'CONFIGURATION_INFORMATION7',l_template.configuration_information7,
'CONFIGURATION_INFORMATION8',l_template.configuration_information8,
'CONFIGURATION_INFORMATION9',l_template.configuration_information9,
'CONFIGURATION_INFORMATION10',l_template.configuration_information10)
INTO l_excl_set_value
FROM dual ;
PROCEDURE delete_pre_process
(p_template_id IN NUMBER)
IS
CURSOR csr_et IS
SELECT pet.element_type_id
, pet.effective_start_date
FROM pay_element_types_f pet,
pay_shadow_element_types pset
WHERE pset.template_id = p_template_id
AND pset.element_name = pet.element_name;
l_procedure CONSTANT VARCHAR2(100) := g_package ||'delete_pre_process';
END delete_pre_process;