Re: NEED HELP w/ TRIGGER problem
Posted in 1995
Topics: Stored Procedures & SPL, Triggers, Constraints & Referential Integrity
Mark.Denham@bbc.co.uk (Mark Denham) wrote:
>
>Mike Stenzler wrote:
>
><Bits removed>
>
>THIS FAILS:
> create trigger t_upt1
> update of c1, c2 on t1
> referencing old as o new as n
> for each row (execute procedure sp_calct1(n.c1, n.c2) into c3)
> after (execute procedure sp_upt2(c4, c5));> ^^^^^
>If this is exactly what you have, your problem is that you are not
>prefixing c4/c5 with the record id 'o' or 'n' ie o.c4, o.c5. This aught
>to solve your problem.
>
>THIS SUCCEEDS:
> create trigger t_upt1
> update of c1, c2 on t1
> referencing old as o new as n
> for each row (execute procedure sp_calct1(n.c1, n.c2) into c3)
> after (execute procedure sp_upt2());>
Well actually, what I wrote was correct EXACTLY as I wrote it -
I've had a few folks assume I made a typo - NOT!
As per the Informix manual - correlation names may only be used
in a foreach statement - not in the before or after statements.
I knew that but my poor overworked brain couldn't put that together
with the reason I was unable to pass parameters to a stored procedure
called from the after statement.
W/o correlation names & outside of the foreach row loop, there is
no knowledge of which row we are refferinfg to. This precludes
passing any parameters.
--
Mike Stenzler 70 Hudson St. 201.798.5784
Mgr. Info. Sys. Hoboken, NJ 201.798.6367 fax
RPCG, Inc. 07030 rpcg@panix.com
All content my opinion only - not RPCG's.