The following lines contain the word 'select', 'insert', 'update' or 'delete':
g_build_package_tbl.DELETE;
SELECT c.condition_id, c.user_sequence, c.left_parenthesis_code, c.left_entity_code, LeftEnt.table_name left_tbl_name,
LeftAttr.attribute_code left_column_name, c.right_entity_code, RightEnt.table_name right_tbl_name,
RightAttr.attribute_code right_column_name, c.attribute_constant_number, c.attribute_constant_character,
c.attribute_constant_date, c.attribute_expression, c.line_operator_code, c.right_parenthesis_code,
c.logical_operator_code
FROM inl_conditions c,
inl_entities_vl LeftEnt,
inl_attributes_vl LeftAttr,
inl_entities_vl RightEnt,
inl_attributes_vl RightAttr
WHERE RightAttr.attribute_code (+) = c.right_attribute_code
AND RightAttr.entity_code (+) = c.right_entity_code
AND RightEnt.entity_code (+) = c.right_entity_code
AND LeftEnt.entity_code = c.left_entity_code
AND LeftAttr.attribute_code = c.left_attribute_code
AND LeftAttr.entity_code = c.left_entity_code
AND c.rule_id = p_rule_id
ORDER BY c.user_sequence;
SELECT DISTINCT e.entity_code, e.table_name || ' ' || e.entity_code AS from_table_name
FROM inl_entities_vl e,
inl_conditions c
WHERE e.entity_code = c.left_entity_code
AND e.table_name IS NOT NULL
AND c.rule_id = p_rule_id
UNION
SELECT DISTINCT e.entity_code, e.table_name || ' ' || e.entity_code AS from_table_name
FROM inl_entities_vl e,
inl_conditions c
WHERE e.entity_code = c.right_entity_code
AND e.table_name IS NOT NULL
AND c.rule_id = p_rule_id;
SELECT usage_code
INTO l_usage_code
FROM inl_rules_vl
WHERE rule_id = p_rule_id;
SELECT COUNT(1)
INTO l_condition_count
FROM inl_conditions
WHERE rule_id = p_rule_id;
l_query := 'SELECT COUNT(1) ' || l_from_clause || l_where_clause_cond;
SELECT status
FROM user_objects
WHERE object_name = UPPER(p_package_name)
AND object_type = 'PACKAGE'
AND status <> 'VALID'
AND rownum = 1;
SELECT user
INTO l_applsys_schema
FROM dual;
SELECT r.package_name, r.rule_name
INTO l_package_name, l_rule_name
FROM inl_rules_vl r
WHERE r.package_name IS NOT NULL
AND r.rule_id = p_rule_id;
SELECT status
FROM user_objects
WHERE object_name = UPPER(p_package_name)
AND object_type = 'PACKAGE BODY'
AND status <> 'VALID'
AND rownum = 1;
SELECT c.user_sequence, c.right_entity_code, RAttr.datatype_code,
DECODE(c.right_entity_code, 'CONS_CHAR', 'VARCHAR2(240)',
DECODE(c.right_entity_code,'CONS_NUMBER', 'NUMBER',
DECODE(c.right_entity_code,'CONS_DATE', 'DATE', NULL))) AS datatype,
c.attribute_expression, c.attribute_constant_character,
c.attribute_constant_number, c.attribute_constant_date
FROM inl_conditions c,
inl_attributes_vl RAttr
WHERE RAttr.attribute_code (+) = c.right_attribute_code
AND c.rule_id = p_rule_id
AND c.right_entity_code IN ('CONS_CHAR', 'CONS_NUMBER', 'CONS_DATE')
ORDER BY c.user_sequence;
SELECT user
INTO l_applsys_schema
FROM dual;
SELECT irb.package_name, irb.rule_name
INTO l_package_name, l_rule_name
FROM inl_rules_vl irb
WHERE irb.package_name IS NOT NULL
AND rule_id = p_rule_id;
SELECT r.rule_name, r.usage_code
INTO l_rule_name, l_usage_code
FROM inl_rules_vl r
WHERE r.rule_id = p_rule_id;
UPDATE inl_rules_b
SET package_name = 'INL_RULE_' || p_rule_id
WHERE package_name IS NULL
AND rule_id = p_rule_id;
SELECT count(1)
FROM inl_conditions c
WHERE c.rule_id = p_rule_id
AND c.left_parenthesis_code IS NOT NULL
MINUS
SELECT count(1)
FROM inl_conditions c1
WHERE c1.rule_id = p_rule_id
AND c1.right_parenthesis_code IS NOT NULL;
SELECT c.user_sequence, c.left_parenthesis_code,
c.right_parenthesis_code, NULL AS right_parenthesis_close
FROM inl_conditions c
WHERE rule_id = p_rule_id
ORDER BY c.user_sequence;
SELECT c.user_sequence
FROM inl_conditions c
WHERE c.rule_id = p_rule_id
AND c.logical_operator_code IS NULL
AND c.user_sequence <> p_sequence
AND NOT EXISTS (SELECT condition_id
FROM inl_conditions c2
WHERE c2.rule_id = p_rule_id
AND c2.left_parenthesis_code IS NOT NULL
AND c2.left_entity_code IS NULL
AND c2.condition_id = c.condition_id);
SELECT 'x'
FROM inl_conditions c
WHERE c.rule_id = p_rule_id
AND c.left_entity_code IS NULL
AND c.right_parenthesis_code IS NOT NULL
AND c.user_sequence = (SELECT a.user_sequence
FROM inl_conditions a
WHERE a.rule_id = c.rule_id
AND a.user_sequence > l_no_logical_operator.user_sequence
AND rownum = 1);
SELECT c.user_sequence, c.right_entity_code, RAttr.datatype_code,
c.attribute_expression, c.attribute_constant_character,
c.attribute_constant_number, c.attribute_constant_date
FROM inl_conditions c,
inl_attributes_vl RAttr
WHERE RAttr.attribute_code (+) = c.right_attribute_code
AND c.rule_id = p_rule_id
AND c.right_entity_code IN ( 'EXPR', 'CONS_CHAR')
ORDER BY c.user_sequence;
SELECT count(1)
INTO l_count_condition
FROM inl_conditions c
WHERE c.rule_id = p_rule_id;
SELECT NVL(max(user_sequence),0)
INTO l_max_left_seq
FROM inl_conditions c
WHERE c.rule_id = p_rule_id
AND c.left_parenthesis_code IS NOT NULL;
SELECT NVL(max(user_sequence),0)
INTO l_max_right_seq
FROM inl_conditions c
WHERE c.rule_id = p_rule_id
AND c.right_parenthesis_code IS NOT NULL;
SELECT NVL(min(user_sequence),0)
INTO l_min_left_seq
FROM inl_conditions c
WHERE c.rule_id = p_rule_id
AND c.left_parenthesis_code IS NOT NULL;
SELECT NVL(min(user_sequence),0)
INTO l_min_right_seq
FROM inl_conditions c
WHERE c.rule_id = p_rule_id
AND c.right_parenthesis_code IS NOT NULL;
SELECT max(user_sequence)
INTO l_desc_user_sequence
FROM inl_conditions c
WHERE c.rule_id = p_rule_id;
SELECT count(1)
INTO l_last_row_with_logical_oper
FROM inl_conditions c
WHERE c.rule_id = p_rule_id
AND c.user_sequence = l_desc_user_sequence
AND c.logical_operator_code IS NOT NULL;
SELECT COUNT(1)
INTO l_valid_function
FROM user_objects
WHERE object_name = l_db_function
AND object_type = 'FUNCTION';
SELECT package_name
INTO l_package_name
FROM inl_rules_vl
WHERE rule_id = p_rule_id;
SELECT COUNT(1)
INTO l_exist_package_spec
FROM user_objects
WHERE object_name = UPPER(l_package_name)
AND object_type = 'PACKAGE'
AND rownum = 1;
SELECT COUNT(1)
INTO l_exist_package_body
FROM user_objects
WHERE object_name = UPPER(l_package_name)
AND object_type = 'PACKAGE BODY'
AND rownum = 1;