Re: After Update Trigger Problem

From: Matt Connors <mdconnor_at_wheel.ucdavis.edu>
Date: 27 Oct 1994 04:31:47 GMT
Message-ID: <38nafj$s8f_at_mark.ucdavis.edu>


In article <navisCy03x3.CD0_at_netcom.com>, navis_at_netcom.com (Navis Corp) says:
>
>
>The following after-update trigger doesn't work as expected.
>When the trigger reaches the "alerts_eq.alert_update" package
>procedure call, the value of "my_class" is *always* 'POS',
>regardless of which table attribute is updated.
>
> CREATE OR REPLACE TRIGGER trig_eq
> AFTER UPDATE OF step ON equipment
> FOR EACH ROW
> /* no WHEN-clause constraints for now */
> DECLARE
> my_class CHAR(3);
> BEGIN
> my_class := 'EQP';
> IF UPDATING ('STEP') THEN
> my_class := 'POS';
> END IF;
> alerts_eq.alert_update( my_class, :old.nbr, :new.nbr );
> END;
>

I haven't worked with triggers that much, but I read this trigger as only firing when the step column is updated. So the test for the if condition will always be true, and my_class will always get set to 'POS'.

Matt Connors
Oracle Services Received on Thu Oct 27 1994 - 05:31:47 CET

Original text of this message