The following lines contain the word 'select', 'insert', 'update' or 'delete':
procedure delete_process_data(p_process_run_id in number) is
--
begin
--
delete hr_summary_key_value
where item_value_id in (select item_value_id
from hr_summary_item_value
where process_run_id = p_process_run_id);
delete hr_summary_item_value
where process_run_id = p_process_run_id;
delete hr_summary_parameter
where process_run_id = p_process_run_id;
delete hr_summary_process_run
where process_run_id = p_process_run_id;
end delete_process_data;
select it.DATATYPE
, it.count_clause1
, it.count_clause2
, it.where_clause
, it.name it_name
, itu.name itu_name
, itu.ITEM_TYPE_USAGE_ID
, itu.ITEM_TYPE_ID
from hr_summary_item_type_usage itu
, hr_summary_item_type it
where itu.template_id = p_template_id
and itu.ITEM_TYPE_ID = it.ITEM_TYPE_ID
and nvl(p_item_type_usage_id,item_type_usage_id) = item_type_usage_id
order by itu.sequence_number;
select kty.name
, kty.key_function
, kty.key_type_id
from hr_summary_key_type_usage ktu
, hr_summary_valid_key_type vkt
, hr_summary_key_type kty
where kty.key_type_id = vkt.key_type_id
and ktu.valid_key_type_id = vkt.valid_key_type_id
and ktu.item_type_usage_id = p_item_type_usage_id;
select srt.data_type
, srt.restriction_clause
, vru.restriction_type
, vru.restriction_usage_id
, srt.name
from hr_summary_valid_restriction vrt
, hr_summary_restriction_usage vru
, hr_summary_restriction_type srt
where vrt.valid_restriction_id = vru.valid_restriction_id
and vru.item_type_usage_id = p_item_type_usage_id
and vrt.restriction_type_id = srt.restriction_type_id
and srt.name <> 'USER_PERSON_TYPE';
select value
from hr_summary_restriction_value
where restriction_usage_id = p_restriction_usage_id;
For each of the item types that are required for the selected template,
retrieve the item type details
------------------------------------------------------------------ */
i := 1;
a) delete any existing item values or key values for the item type usage
b) build up the dynamic SQL statement and excute (if appropriate)
------------------------------------------------------------------ */
if ituTab.count > 0 then
<>
for x in 1..i-1 loop
--
-- Populate local and global variables
--
hr_summary_util.item_type_usage_id := ituTab(x).item_type_usage_id;
b) build up the select clause
c) build up the group by clause
----------------------------------------------------------------- */
--
hr_utility.trace('hrsumrep - keytab');
l_stmt := 'select '||
l_count_clause1 ||
l_count_clause2 ||
l_key_col_clause || '
'||
l_where_clause || '
'||
l_group_clause;
select it.DATATYPE
, it.count_clause1
, it.count_clause2
, it.where_clause
, it.name it_name
, itu.name itu_name
, itu.ITEM_TYPE_USAGE_ID
, itu.ITEM_TYPE_ID
from hr_summary_item_type_usage itu
, hr_summary_item_type it
where itu.template_id = p_template_id
and itu.ITEM_TYPE_ID = it.ITEM_TYPE_ID
and nvl(p_item_type_usage_id,item_type_usage_id) = item_type_usage_id
order by itu.sequence_number;
select kty.name
, kty.key_function
, kty.key_type_id
from hr_summary_key_type_usage ktu
, hr_summary_valid_key_type vkt
, hr_summary_key_type kty
where kty.key_type_id = vkt.key_type_id
and ktu.valid_key_type_id = vkt.valid_key_type_id
and ktu.item_type_usage_id = p_item_type_usage_id;
select srt.data_type
, srt.restriction_clause
, vru.restriction_type
, vru.restriction_usage_id
, srt.name
from hr_summary_valid_restriction vrt
, hr_summary_restriction_usage vru
, hr_summary_restriction_type srt
where vrt.valid_restriction_id = vru.valid_restriction_id
and vru.item_type_usage_id = p_item_type_usage_id
and vrt.restriction_type_id = srt.restriction_type_id
and srt.name <> 'USER_PERSON_TYPE';
select value
from hr_summary_restriction_value
where restriction_usage_id = p_restriction_usage_id;
For each of the item types that are required for the selected template,
retrieve the item type details
------------------------------------------------------------------ */
i := 1;
a) delete any existing item values or key values for the item type usage
b) build up the dynamic SQL statement and excute (if appropriate)
------------------------------------------------------------------ */
if ituTab.count > 0 then
<>
for x in 1..i-1 loop
--
-- Populate local and global variables
--
hr_summary_util.item_type_usage_id := ituTab(x).item_type_usage_id;
b) build up the select clause
c) build up the group by clause
----------------------------------------------------------------- */
--
hr_utility.trace('hrsumrep - keytab');
l_stmt := 'select '||
l_count_clause1 ||
l_count_clause2 ||
l_key_col_clause || '
'||
l_where_clause || '
'||
l_group_clause;