The following lines contain the word 'select', 'insert', 'update' or 'delete':
p_select_group IN NUMBER DEFAULT 1)
IS
------------------------------------------------------------------
--Created by : nsinha, Oracle India
--Date created: 12-Mar-2001
--
--Purpose: Expand description_number to IGS_RU_DESCRIPTION or group_name
-- if invalid set message number and return NULL
--
--Known limitations/enhancements and/or remarks:
--
--Change History:
--Who When What
--nsinha 12-Mar-2002 Bug# 2233951: Moved the content of this
-- procedure in Igs_ru_gen_006.Rulp_Ins_Make_Rule
-- and called it from there.
--
-------------------------------------------------------------------
BEGIN
Igs_ru_gen_006.Rulp_Ins_Make_Rule (
p_description_number,
p_return_type,
p_rule_description,
p_turing_function,
p_rule_text,
p_message_rule_text,
p_description_text,
p_group,
p_select_group);
p_insert_rule_only IN BOOLEAN ,
p_rul_sequence_number OUT NOCOPY NUMBER ,
p_message_name OUT NOCOPY VARCHAR2 )
RETURN BOOLEAN IS
------------------------------------------------------------------
--Created by : nsinha, Oracle India
--Date created: 12-Mar-2002
--
--Purpose:
-- This module inserts a IGS_PS_UNIT_RU asscoaited with a IGS_PS_UNIT. This involves:
-- Creating IGS_PS_UNIT_RU IGS_RU_RULE and associated records (IGS_RU_RULE) when the
-- IGS_PS_UNIT_RU does not already exist.
-- Set the default message number
--
--Known limitations/enhancements and/or remarks:
--
--Change History:
--Who When What
--nsinha 12-Mar-2002 Bug# 2233951: Modified the logic to
-- SELECT the next value of the sequence number
-- differently when the data is for SEED DB.
--
-------------------------------------------------------------------
gv_other_detail VARCHAR2(255);
SELECT ur.rul_sequence_number
FROM IGS_PS_UNIT_RU ur
WHERE ur.unit_cd = p_unit_cd AND
ur.s_rule_call_cd = p_s_rule_call_cd;
SELECT count(*)
FROM IGS_PS_UNIT_RU ur
WHERE ur.unit_cd = p_unit_cd AND
ur.s_rule_call_cd = p_s_rule_call_cd;
SELECT IGS_RU_RULE_SEQ_NUM_S.NEXTVAL
FROM DUAL;
SELECT MAX (sequence_number) + 1 sequence_number
FROM IGS_RU_RULE
WHERE sequence_number < 499999;
IGS_RU_RULE_PKG.Insert_Row(
x_rowid => v_rowid,
x_sequence_number => s_n_next
);
IF p_insert_rule_only = FALSE THEN
IGS_PS_UNIT_RU_PKG.Insert_Row(
x_rowid => v_rowid_pur,
x_unit_cd => p_unit_cd,
x_s_rule_call_cd => p_s_rule_call_cd,
x_rul_sequence_number => s_n_next
);
SELECT NR.rul_sequence_number
INTO v_rule_number
FROM IGS_RU_DESCRIPTION RUD,
IGS_RU_NAMED_RULE NR
WHERE RUD.s_return_type = p_return_type
AND RUD.rule_description = p_rule_name
AND NR.rud_sequence_number = RUD.sequence_number;