DBA Data[Home] [Help]

TRIGGER: APPS.BOM_STD_SUB_OP_RESOURCES_T3

Source

Description
"APPS"."BOM_STD_SUB_OP_RESOURCES_T3" 
	BEFORE DELETE
 ON  "BOM"."BOM_STD_SUB_OP_RESOURCES#"  FOR EACH ROW

Type
BEFORE EACH ROW
Event
DELETE
Column
When
Referencing
REFERENCING NEW AS NEW OLD AS OLD
Body
DECLARE

CURSOR op_seq IS
SELECT operation_sequence_id
FROM bom_operation_sequences
WHERE standard_operation_id = :old.standard_operation_id
AND   reference_flag = 1;

var_op_seq_id NUMBER;
BEGIN
    OPEN op_seq;
    LOOP
        FETCH op_seq
        INTO  var_op_seq_id;

        EXIT WHEN op_seq%NOTFOUND;

		DELETE from bom_sub_operation_resources
		WHERE  operation_sequence_id = var_op_seq_id
		AND    substitute_group_num = :old.substitute_group_num
                AND    replacement_group_num = :old.replacement_group_num;

	END LOOP;
END;