The following lines contain the word 'select', 'insert', 'update' or 'delete':
Procedure chk_non_updateable_args
(p_effective_date in date
,p_rec in hxc_ter_shd.g_rec_type
) IS
--
l_proc varchar2(72) := g_package || 'chk_non_updateable_args';
End chk_non_updateable_args;
SELECT 'error'
FROM hxc_time_entry_rules ter
WHERE
ter.name = p_name AND
( ter.time_entry_rule_id <> p_time_entry_rule_id OR
p_time_entry_rule_id IS NULL )
AND (
( ter.business_group_id IS NULL AND
ter.legislation_code IS NULL )
OR
( ter.legislation_code IS NOT NULL AND
ter.legislation_code = p_legislation_code )
OR
( ter.business_group_id IS NOT NULL AND
ter.business_group_id = NVL( p_bg_id, -1 ) )
OR
( p_bg_id IS NULL ) )
AND (
(
( p_start_date BETWEEN
ter.start_date AND NVL(ter.end_date, HR_GENERAL.END_OF_TIME )
)
OR
( NVL(p_end_date, HR_GENERAL.END_OF_TIME ) BETWEEN
ter.start_date AND NVL(ter.end_date, HR_GENERAL.END_OF_TIME )
)
)
OR
( ter.start_date BETWEEN
p_start_date AND NVL(p_end_date, HR_GENERAL.END_OF_TIME )
)
OR
( NVL(ter.end_date, HR_GENERAL.END_OF_TIME ) BETWEEN
p_start_date AND NVL(p_end_date, HR_GENERAL.END_OF_TIME )
)
);
SELECT 'ok'
FROM hr_lookups
WHERE lookup_type = 'HXC_APPROVAL_RULE_USAGE'
AND lookup_code = p_rule_usage;
SELECT 'ok'
FROM dual
WHERE EXISTS (
SELECT 'x'
FROM hxc_mappings
WHERE mapping_id = p_mapping_id );
SELECT 'ok'
FROM dual
WHERE EXISTS (
SELECT 'x'
FROM ff_formulas_f
WHERE formula_id = p_formula_id
AND effective_start_date <= p_start_date
AND effective_end_date >= p_end_date );
SELECT 'error'
FROM hxc_time_entry_rules ter
WHERE
ter.name = p_name AND
ter.object_version_number <> NVL(p_ovn, -1)
AND (
( ter.business_group_id IS NULL AND
ter.legislation_code IS NULL )
OR
( ter.legislation_code IS NOT NULL AND
ter.legislation_code = p_legislation_code )
OR
( ter.business_group_id IS NOT NULL AND
ter.business_group_id = NVL( p_bg_id, -1 ) )
OR
( p_bg_id IS NULL ) )
AND
p_start_date BETWEEN
ter.start_date AND NVL(ter.end_date, HR_GENERAL.END_OF_TIME );
SELECT 'error'
FROM hxc_time_entry_rules ter
WHERE
ter.name = p_name AND
ter.object_version_number <> NVL(p_ovn, -1)
AND (
( ter.business_group_id IS NULL AND
ter.legislation_code IS NULL )
OR
( ter.legislation_code IS NOT NULL AND
ter.legislation_code = p_legislation_code )
OR
( ter.business_group_id IS NOT NULL AND
ter.business_group_id = NVL( p_bg_id, -1 ) )
OR
( p_bg_id IS NULL ) )
AND
p_end_date BETWEEN
ter.start_date AND NVL(ter.end_date, HR_GENERAL.END_OF_TIME );
Procedure chk_delete
(
p_time_entry_rule_id in hxc_time_entry_rules.time_entry_rule_id%TYPE
) IS
l_proc varchar2(72);
SELECT 'exists'
FROM hxc_entity_group_comps egc
WHERE egc.entity_type = 'TIME_ENTRY_RULES'
AND egc.entity_id = p_time_entry_rule_id;
SELECT 'exists'
FROM hxc_data_app_rule_usages daru
WHERE daru.time_entry_rule_id = p_time_entry_rule_id;
l_proc := g_package||'chk_delete';
END chk_delete;
select territory_code
from fnd_territories ft
where ft.territory_code = p_legislation_code;
select legislation_code
from per_business_groups pbg
where pbg.business_group_id = p_business_group_id
and pbg.legislation_code = p_legislation_code;
Procedure insert_validate
(p_effective_date in date
,p_rec in hxc_ter_shd.g_rec_type
) is
--
l_proc varchar2(72);
l_proc := g_package||' insert_validate';
End insert_validate;
Procedure update_validate
(p_effective_date in date
,p_rec in hxc_ter_shd.g_rec_type
) is
--
l_proc varchar2(72);
l_proc := g_package||'update_validate';
chk_non_updateable_args
(p_effective_date => p_effective_date
,p_rec => p_rec
);
End update_validate;
Procedure delete_validate
(p_rec in hxc_ter_shd.g_rec_type
) is
--
l_proc varchar2(72);
l_proc := g_package||'delete_validate';
chk_delete
(
p_time_entry_rule_id => p_rec.time_entry_rule_id
);
End delete_validate;