The following lines contain the word 'select', 'insert', 'update' or 'delete':
, p_delete BOOLEAN ) IS
l_proc VARCHAR2(72) ;
SELECT
tc.time_category_name
, tc.time_category_id
, tc.object_version_number
FROM
hxc_time_categories tc
WHERE
tc.time_Category_name like p_tc_name;
SELECT pap.accrual_plan_name
FROM pay_accrual_plans pap
WHERE pap.accrual_plan_id = p_pap_id;
SELECT ncr.accrual_plan_id
FROM pay_net_calculation_rules ncr
WHERE ncr.net_calculation_rule_id = p_net_calculation_rule_id;
SELECT
ap.accrual_plan_name
, ncr.element_type_id
, ncr.element_type_name
, ncr.add_or_subtract
FROM
pay_accrual_plans ap
, pay_net_calculation_rules_v ncr
WHERE
ncr.accrual_plan_id = p_pap_id AND
ncr.net_calculation_rule_id = p_ncr_id
AND
ap.accrual_plan_id = ncr.accrual_plan_id
ORDER BY
ncr.net_calculation_rule_id;
SELECT mpc.mapping_component_id
FROM hxc_mapping_components mpc
WHERE mpc.name = 'Dummy Element Context';
SELECT tcc.time_category_comp_id
, tcc.object_version_number
FROM hxc_time_category_comps tcc
WHERE tcc.time_category_id = p_tc_id
AND tcc.component_type_id = p_mpc_id
AND tcc.value_id = TO_CHAR(p_element_type_id);
SELECT 'x'
FROM hxc_time_categories tc
WHERE tc.time_category_id = p_tc_id
AND EXISTS ( select 'x'
FROM hxc_time_category_comps tcc
WHERe tcc.time_category_id = tc.time_category_id );
SELECT MIN (net_calculation_rule_id)
FROM pay_net_calculation_rules
WHERE accrual_plan_id = p_pap_id
AND add_or_subtract = 1;
IF ( p_delete )
THEN
if g_debug then
hr_utility.trace('Delete is TRUE');
hr_utility.trace('Delete is FALSE');
IF ( ( l_dec_tc_name IS NULL ) AND ( NOT p_delete ) AND ( l_accrual_info.add_or_subtract = -1 ) )
THEN
-- create time categories
if g_debug then
hr_utility.set_location('Processing '||l_proc, 40);
-- which can never be deleted
l_dec_tc_name := SUBSTR('OTL_DEC_'||l_accrual_info.accrual_plan_name,1,90);
ELSIF ( ( l_inc_tc_name IS NULL ) AND ( NOT p_delete ) AND ( l_accrual_info.add_or_subtract = 1 ) )
THEN
if g_debug then
hr_utility.trace('Creating INC time component');
ELSIF ( ( l_dec_tc_name IS NOT NULL ) AND ( NOT p_delete ) AND ( l_accrual_info.add_or_subtract = -1 ) )
THEN
-- updating existing time category
if g_debug then
hr_utility.set_location('Processing '||l_proc, 70);
hxc_time_category_comp_api.update_time_category_comp (
p_time_category_comp_id => l_tcc_id
,p_object_version_number => l_tcc_ovn
,p_time_category_id => l_dec_tc_id
,p_ref_time_category_id => NULL
,p_component_type_id => l_mpc_id
,p_flex_value_set_id => -1
,p_value_id => l_accrual_info.element_type_id
,p_is_null => 'Y'
,p_equal_to => 'Y'
,p_type => 'MC' );
ELSIF ( ( l_inc_tc_name IS NOT NULL ) AND ( NOT p_delete ) AND ( l_accrual_info.add_or_subtract = 1 ) )
THEN
if g_debug then
hr_utility.trace('INC TC ID is '||to_char(l_inc_tc_id));
hxc_time_category_comp_api.update_time_category_comp (
p_time_category_comp_id => l_tcc_id
,p_object_version_number => l_tcc_ovn
,p_time_category_id => l_inc_tc_id
,p_ref_time_category_id => NULL
,p_component_type_id => l_mpc_id
,p_flex_value_set_id => -1
,p_value_id => l_accrual_info.element_type_id
,p_is_null => 'Y'
,p_equal_to => 'Y'
,p_type => 'MC' );
-- delete an individual time category comp
-- get tc comp info
IF ( l_accrual_info.add_or_subtract = -1 )
THEN
if g_debug then
hr_utility.trace('delete dec tcc');
hxc_time_category_comp_api.delete_time_category_comp(
p_time_category_comp_id => l_tcc_id
,p_object_version_number => l_tcc_ovn );
-- if it is then delete the time category
OPEN csr_chk_tc_comps ( l_dec_tc_id );
-- delete the whole time category
IF l_dec_tc_id is not null THEN
hxc_time_category_api.delete_time_category (
p_time_category_id => l_dec_tc_id
,p_time_category_name => l_dec_tc_name
,p_object_version_number => l_dec_tc_ovn );
hxc_time_category_comp_api.delete_time_category_comp(
p_time_category_comp_id => l_tcc_id
,p_object_version_number => l_tcc_ovn );
-- cannot delete the last inc ncr and the inc tc exists
hxc_time_category_api.delete_time_category (
p_time_category_id => l_inc_tc_id
,p_time_category_name => l_inc_tc_name
,p_object_version_number => l_inc_tc_ovn );
, p_delete => FALSE );
procedure update_pto_time_category_b (
p_accrual_plan_id NUMBER default null
, p_net_calculation_rule_id NUMBER default null ) IS
BEGIN
maintain_pto_time_category (
p_accrual_plan_id => p_accrual_plan_id
, p_net_calculation_rule_id => p_net_calculation_rule_id
, p_delete => TRUE );
END update_pto_time_category_b;
procedure update_pto_time_category_a (
p_accrual_plan_id NUMBER default null
, p_net_calculation_rule_id NUMBER default null ) IS
BEGIN
maintain_pto_time_category (
p_accrual_plan_id => p_accrual_plan_id
, p_net_calculation_rule_id => p_net_calculation_rule_id
, p_delete => FALSE );
END update_pto_time_category_a;
procedure delete_pto_time_category_b (
p_net_calculation_rule_id NUMBER default null ) IS
BEGIN
maintain_pto_time_category (
p_accrual_plan_id => NULL
, p_net_calculation_rule_id => p_net_calculation_rule_id
, p_delete => TRUE );
END delete_pto_time_category_b;