Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: IF THEN expects an SQL statement in PL/SQL?
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