informix triggers help !!
Posted in 1999
Topics: Triggers, Constraints & Referential Integrity
Hi everyone !!!
I wonder if you can help with this ??
I want to place a trigger on a table, so that when the record on the table
is updated a single field from the record is set from "P" to "Y"
This is to be only done when the customer code matches "93*". I have tried
the following which seems to create a "-747" error !
create trigger update_dinflgupdate of dinflg on delv
for each row(update delv set dinflg = "Y" where dcust matches "93*" and
dinflg = "P");
Is there a better way to do this or away around this problem.
The version of informix is 5.08 using online engine !
Thanks for your help
Will ;-)
In article <7d7v1q$bm6$1@nclient1-gui.server.virgin.net>,
"william.downie" <william.downie@virgin.net> wrote:
> Hi everyone !!!
>
> I wonder if you can help with this ??
>
> I want to place a trigger on a table, so that when the record on the table
> is updated a single field from the record is set from "P" to "Y"
> This is to be only done when the customer code matches "93*". I have tried
> the following which seems to create a "-747" error !
>
> create trigger update_dinflg> update of dinflg on delv
> for each row(update delv set dinflg = "Y" where dcust matches "93*" and
> dinflg = "P");
>
> Is there a better way to do this or away around this problem.
>
> The version of informix is 5.08 using online engine !
>
> Thanks for your help
>
> Will ;-)
>
>
Hi
You can't use this trigger in the way it is written.
This would cause an infinite update on the table, because every time you do an
update to the record on the table, the trigger performs another update in the
same table, and so on.
Check the possibility of doing this update in your application programs.
Paulo Roberto Marelli de Amorim
TS&0 Consulting
Brasil
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own