The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT 1
FROM hri_edw_user_events
WHERE user_event_type = 'GLOBAL_' || p_user_event_type;
PROCEDURE update_global_enabled_flag( p_user_event_type IN VARCHAR2
, p_value IN VARCHAR2 )
IS
BEGIN
UPDATE hri_edw_user_events
SET global_enabled_flag = p_value
WHERE user_event_type = p_user_event_type
OR user_event_type = 'GLOBAL_' || p_user_event_type;
END update_global_enabled_flag;
UPDATE hri_edw_user_events
SET global_threshold_value = p_value
WHERE user_event_type = 'GLOBAL_' || p_user_event_type
OR user_event_type = p_user_event_type;
INSERT INTO hri_edw_user_events
( user_event_id
, user_event_type
, threshold_units
, global_threshold_value
, global_enabled_flag)
VALUES
( hri_edw_user_events_s.nextval
, 'GLOBAL_' || p_user_event_type
, p_threshold_units
, p_global_threshold_value
, p_global_enabled_flag);
update_global_enabled_flag( p_user_event_type, 'Y' );
update_global_enabled_flag( p_user_event_type, 'N' );
SELECT glb.global_threshold_value
,glb.global_enabled_flag
,glb.threshold_units
FROM hri_edw_user_events glb
WHERE glb.user_event_type = 'GLOBAL_' || p_user_event_type
AND NOT EXISTS (SELECT 1
FROM hri_edw_user_events evt
WHERE evt.user_event_type = p_user_event_type
AND evt.event_code = p_event_code);
INSERT INTO hri_edw_user_events
( user_event_id
, user_event_type
, event_code
, threshold_value
, threshold_units
, global_threshold_value
, global_enabled_flag)
VALUES
( hri_edw_user_events_s.nextval
, p_user_event_type
, p_event_code
, p_event_threshold
, l_threshold_units
, l_global_threshold_value
, l_global_enabled_flag);
DELETE FROM hri_edw_user_events
WHERE user_event_type = p_user_event_type
AND event_code = p_event_code;
SELECT
event_code
,parent_event_id
,reason_type
,user_event_type
FROM hri_edw_event_hrchys
WHERE hierarchy = p_hierarchy
AND level_number = p_level_number
AND event_id = p_event_id;
INSERT INTO hri_edw_event_hrchys
( event_id
, hierarchy
, level_number
, event_code
, parent_event_id
, reason_type
, user_event_type )
values
( p_event_id
, p_hierarchy
, p_level_number
, p_event_code
, p_parent_event_id
, p_reason_type
, p_user_event_type );
UPDATE hri_edw_event_hrchys
SET event_code = p_event_code
, parent_event_id = p_parent_event_id
, reason_type = p_reason_type
, user_event_type = p_user_event_type
WHERE hierarchy = p_hierarchy
AND level_number = p_level_number
AND event_id = p_event_id;
SELECT
user_event_type
,event_code
,threshold_value
,threshold_units
,global_threshold_value
,global_enabled_flag
FROM hri_edw_user_events
WHERE user_event_type = p_user_event_type
AND (event_code = p_event_code OR event_code IS NULL);
INSERT INTO hri_edw_user_events
( user_event_id
, user_event_type
, event_code
, threshold_value
, threshold_units
, global_threshold_value
, global_enabled_flag )
values
( hri_edw_user_events_s.nextval
, p_user_event_type
, p_event_code
, p_threshold_value
, p_threshold_units
, p_glbl_thr_value
, p_global_flag );
UPDATE hri_edw_user_events
SET threshold_value = p_threshold_value
, threshold_units = p_threshold_units
, global_threshold_value = p_glbl_thr_value
, global_enabled_flag = p_global_flag
WHERE user_event_type = p_user_event_type
AND (event_code = p_event_code OR event_code IS NULL);
SELECT
combination_id
,gain_event_id
,loss_event_id
,rec_event_id
,sep_event_id
,reason_type
,facts
,description
FROM hri_edw_event_hrchy_cmbns
WHERE combination_id = p_combination_id;
INSERT INTO hri_edw_event_hrchy_cmbns
( combination_id
, gain_event_id
, loss_event_id
, rec_event_id
, sep_event_id
, reason_type
, facts
, description )
values
( p_combination_id
, p_gain_event_id
, p_loss_event_id
, p_rec_event_id
, p_sep_event_id
, p_reason_type
, p_facts
, p_description );
UPDATE hri_edw_event_hrchy_cmbns
SET gain_event_id = p_gain_event_id
, loss_event_id = p_loss_event_id
, rec_event_id = p_rec_event_id
, sep_event_id = p_sep_event_id
, reason_type = p_reason_type
, facts = p_facts
, description = p_description
WHERE combination_id = p_combination_id;