Thread: RE: triggers
View Single Post

   
  #3 (permalink)  
Old 04-20-2008, 09:33 AM
Jonathan Leffler
 
Posts: n/a
Default Re: triggers

christrier wrote:
> you mean it is possible to write it exactly like this:
> CREATE TRIGGER before_trig
> INSERT ON table1 REFERENCING NEW AS new
> FOR EACH ROW
> (
> UNLOAD TO 'file' VALUES (new.col1, new.col2, new.col3, ...,
> new.coln)
> system "cat file >> file.append"
> );
> ?


No - any trigger that tries to include UNLOAD is going to fail, as Art
already said!

If you want to do it, you'll probably need a C code UDR (not running on
a CPU VP - but on a user-defined VP class) to do it. You could consider
using a Java UDR instead - probably.


--
Jonathan Leffler #include <disclaimer.h>
Email: jleffler@earthlink.net, jleffler@us.ibm.com
Guardian of DBD::Informix v2005.01 -- http://dbi.perl.org/
Reply With Quote