DBA Data[Home] [Help]

TRIGGER: APPS.BOM_STD_OP_RESOURCES_T3

Source

Description
bom_std_op_resources_t3
	BEFORE DELETE ON bom_std_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_operation_resources
		WHERE  operation_sequence_id = var_op_seq_id
		AND    resource_seq_num = :old.resource_seq_num;

	END LOOP;
END;