A script-enabled browser is required for this page to function properly.

On-Check-Delete-Master Trigger

Description

Oracle Forms creates this trigger automatically when you define a master/detail relation and set the Delete Record Behavior property to Non-Isolated. It fires when there is an attempt to delete a record in the master block of a master/detail relation.

Definition Level form or block

Legal Commands

Any command, unrestricted Built-ins, restricted Built-ins

Enter Query Mode no

On Failure

Prevents the deletion of the current master record

Fires In

Master/Detail Coordination

On-Check-Delete-Master Trigger Examples

Example

The following example replaces the On-Check-Delete-Master that is generated by default for a master/detail relation with a trigger that will fail if the sum of the distributions does not equal the purchase order total.

DECLARE
the_sum NUMBER;
BEGIN
SELECT SUM(dollar_amt)
INTO the_sum
FROM po_distribution
WHERE po_number = :purchase_order.number;

/* Check for errors */
IF the_sum <> :purchase_order.total THEN
Message('PO Distributions do not reconcile.');
RAISE Form_Trigger_Failure;
ELSIF form_fatal OR form_failure THEN
raise form_trigger_failure;
end if;
END;