Re: After Update Trigger Problem

From: SANJAY PURI <skp_at_ix.netcom.com>
Date: 21 Oct 1994 14:49:38 GMT
Message-ID: <388ke2$f2v_at_ixnews1.ix.netcom.com>


In <navisCy03x3.CD0_at_netcom.com> navis_at_netcom.com (Navis Corp) writes:

>
>
>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;
>
>Does anyone have any ideas?
>Thanks,
>
>Oracle7 Server Release 7.1.3.0.0 - Production Release
>PL/SQL Release 2.1.3.0.0 - Production
>--
>Sung U. Kim | Navis Corporation
>Senior Software Engineer | 1616 Franklin St., Suite 204
>kims_at_navis.com | Oakland, CA 94612
>Voice: (510)763-5715 | U.S.A.
>
Modify this trigger as given below and try :

    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 :old.STEP != :new.STEP then
            my_class := 'POS';
        END IF;
        alerts_eq.alert_update( my_class, :old.nbr, :new.nbr );
    END; VK Nair Received on Fri Oct 21 1994 - 15:49:38 CET

Original text of this message