Thanks for your answer,
As John Carlson said, I think the way to go is by using a stored procedure...
Chucho!
-----Original Message-----
From: "rkusenet" <rkusenet@gmail.com>
To: informix-list@iiug.org
Date: Fri, 24 Sep 2004 06:15:34 -0400
Subject: Re: Trigger question: data values in a AFTER clause
"Jean Sagi" <jeansagi@myrealbox.com> wrote in message news:civsd8$c0g$1@news.xmission.com...
>
>
> It is possible to access the values from an update in an AFTER clause of a trigger?
>
> I could reference the old and new values with a FOR EACH ROW clause of a trigger (using REFERENCING OLD/NEW).
>
> But when I try to use the old or new values in an AFTER clause informix gives 732 error stating that old and new values only works
in the scope of the for each row clause.
>
> So in the after clause how can I access the values that are being updated?, if it is possible of course (The manual is not very
ilustrative on this theme).
>
> BTW: I'm using IDS 9.3/9.4
You can not. To work with updated values means that you have to look into a set of data.
Only FOR EACH ROW can do that. However, depending on the complexity you can do it as
follows:-
BEFORE
initialize some variable/temp table
FOR EACH ROW
store the updated values in variable/temp table
AFTER
use the updated values/temp table to do the work.
Definitely not elegant, but you can work with the set of data after it has been
updated.
Jean Sagi
jeansagi@myrealbox.com
jeansagi@yahoo.com
sending to informix-list