The following lines contain the word 'select', 'insert', 'update' or 'delete':
IS SELECT
condition_id,
group_number,
modifier_flag,
validation_application_id,
validation_entity_short_name,
validation_tmplt_short_name,
record_set_short_name,
scope_op,
validation_pkg,
validation_proc
FROM oe_pc_conditions_v
WHERE constraint_id = p_constraint_id
ORDER BY group_number;
SELECT DISTINCT
c.constraint_id, c.entity_id
,c.on_operation_action
FROM oe_pc_constraints c,
oe_pc_assignments a
WHERE (a.responsibility_id = p_responsibility_id OR a.responsibility_id IS NULL)
AND a.constraint_id = c.constraint_id
AND c.entity_id = G_ENTITY_ID
AND c.constrained_operation = p_operation
-- if caller is defaulting then DO NOT CHECK those constraints
-- that have honored_by_def_flag = 'N'
AND decode(honored_by_def_flag,'N',decode(p_is_caller_defaulting,'Y','N','Y'),
nvl(honored_by_def_flag,'Y')) = 'Y'
AND decode(c.column_name, '',decode(p_check_all_cols_constraint,'Y',
nvl(p_column_name,'#NULL'),'#NULL'),c.column_name) = nvl(p_column_name,'#NULL')
AND NOT EXISTS (
SELECT 'EXISTS'
FROM OE_PC_EXCLUSIONS e
WHERE e.responsibility_id = p_responsibility_id
AND e.assignment_id = a.assignment_id
);
SELECT DISTINCT
c.constraint_id, c.entity_id
,c.on_operation_action
FROM oe_pc_constraints c,
oe_pc_assignments a
WHERE (a.responsibility_id = p_responsibility_id OR a.responsibility_id IS NULL)
AND a.constraint_id = c.constraint_id
AND c.entity_id = G_ENTITY_ID
AND ( ( c.constrained_operation = OE_PC_GLOBALS.CREATE_OP
AND p_column_name IS NULL )
OR ( c.constrained_operation = OE_PC_GLOBALS.UPDATE_OP
AND c.check_on_insert_flag = 'Y'
AND nvl(c.column_name, '#NULL') = NVL(p_column_name,'#NULL') )
)
-- if caller is defaulting then DO NOT CHECK those constraints
-- that have honored_by_def_flag = 'N'
AND decode(honored_by_def_flag,'N',decode(p_is_caller_defaulting,'Y','N','Y'),
nvl(honored_by_def_flag,'Y')) = 'Y'
AND NOT EXISTS (
SELECT 'EXISTS'
FROM OE_PC_EXCLUSIONS e
WHERE e.responsibility_id = p_responsibility_id
AND e.assignment_id = a.assignment_id
);