Re: SQL Trigger on insert
Posted in 2000
Yes you can! We have a trigger working in our system, it looks like: create trigger "informix".mytable_insert_trigger insert on "informix".mytable referencing new as post_upd for each row ( update "informix".mytable set "informix".mytable.mytable_id = mytable_no where (mytable_no = post_upd.mytable_no) ); "mytable_no" is the primary key on "mytable", and we have a field called "mytable_id", for every new record we set mytable_id to mytable_no (don't ask what's that for), it works fine. Informix Dynamic Server Version 7.30.UC8 SunOS myserver 5.6 Generic_105181-16 sun4u sparc SUNW,UltraAX-MP Regards, Carl Y. Wu liat wrote in message <8jfd2j$bss$1@news.xmission.com>... > > >--------------305DEBFAD55DFBFF0F5F06A6 >Content-Type: text/plain; charset=us-ascii >Content-Transfer-Encoding: 7bit > >You can't change inside a trigger the data in the triggered table > >Liat > >Tom wrote: > >> Hi, >> >> I have trigger on insert. Is this possible to change (by this trigger) 1 >> column in record which is inserted? >> Thanks for all answers >> >> Tom > >--------------305DEBFAD55DFBFF0F5F06A6 >Content-Type: text/html; charset=us-ascii >Content-Transfer-Encoding: 7bit > ><!doctype html public "-//w3c//dtd html 4.0 transitional//en"> ><html> ><font size=+2>You can't change inside a trigger the data in the triggered >table</font><font size=+2></font> ><p><font size=+2>Liat</font><font size=+2></font> ><p><font size=+2>Tom wrote:</font> ><blockquote TYPE=CITE><font size=+2>Hi,</font><font size=+2></font> ><p><font size=+2> I have trigger on insert. Is this possible >to change (by this trigger) 1</font> ><br><font size=+2>column in record which is inserted?</font> ><br><font size=+2>Thanks for all answers</font><font size=+2></font> ><p><font size=+2>Tom</font></blockquote> ><font size=+2></font></html> > >--------------305DEBFAD55DFBFF0F5F06A6-- >