Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: IF THEN expects an SQL statement in PL/SQL?

Re: IF THEN expects an SQL statement in PL/SQL?

From: Arjan van Bentem <avbentem_at_DONT-YOU-DAREdds.nl>
Date: Thu, 18 Mar 1999 20:34:42 +0100
Message-ID: <36f15553$0$26176@newton>


frank wrote
>I'm writing a trigger, and I've got the following problem.

>And This doesn't:
> IF monateDazwischen > 0 THEN
> einfuegewert := 1010;
> ELSE
> einfuegewert := 2222;
> END IF;
What do you mean: does not work? Does it give you an error (I don't think so) or does it simply not do what you expect? Where has einfuegewert been defined? Is it a column in your table, or a variable? Uhhh, give us more details! The statement seems correct to me.

If einfuegewert is a column in your trigger table, then remember to use the word :new

    IF monateDazwischen > 0 THEN

        :new.einfuegewert := 1010;
    ELSE
        :new.einfuegewert := 2222;
    END IF; Simulary, use the word :old to refer to the old values when it is a before update trigger.

Arjan. Received on Thu Mar 18 1999 - 13:34:42 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US