The following lines contain the word 'select', 'insert', 'update' or 'delete':
FOR rule_rec IN (SELECT RULE_ID
FROM IEC_G_RULES
WHERE OWNER_ID = p_owner_id
AND OWNER_TYPE_CODE = p_owner_type_code)
LOOP
----------------------------------------------------------------
-- Retrieve all of the field criteria that have been defined for
-- the current rule from the IEC_G_FIELD_CRITERIA table. The
-- combination code is also retrieved, this is either an AND
-- or an OR value that is used when creating the entity's
-- contribution to the dynamic SQL where clause.
----------------------------------------------------------------
FOR criteria_rec IN (SELECT CRITERIA_ID
, COMBINATION_CODE
FROM IEC_G_FIELD_CRITERIA
WHERE RULE_ID = rule_rec.RULE_ID)
LOOP
----------------------------------------------------------------
-- Retrieve all of the fields that have been defined for
-- the current field criterion from the IEC_G_FIELDS table. The
-- columns retrieved are used when creating the entity's
-- contribution to the dynamic SQL where clause.
----------------------------------------------------------------
FOR field_rec IN (SELECT A.FIELD_NAME FIELD_NAME
, A.FIELD_VALUE FIELD_VALUE
, A.OPERATOR_CODE OPERATOR_CODE
, B.SQL_OPERATOR SQL_OPERATOR
, B.IS_UNARY_FLAG IS_UNARY_FLAG
FROM IEC_G_FIELDS A
, IEC_O_ALG_OP_DEFS_B B
WHERE A.CRITERIA_ID = criteria_rec.CRITERIA_ID
AND A.OPERATOR_CODE = B.OPERATOR_CODE)
LOOP
----------------------------------------------------------------
-- We need to get the data type for the view column used in
-- order to handle it correctly when we create the dynamic SQL.
----------------------------------------------------------------
BEGIN
SELECT DATA_TYPE
INTO L_FIELD_TYPE
FROM USER_TAB_COLUMNS
WHERE TABLE_NAME = P_VIEW_NAME
AND COLUMN_NAME = field_rec.FIELD_NAME;