RE: Insert Trigger Problem
Posted in 1997
I'm afraid you will have to do your thing in PB. For unknown reasons, Informix won't let you update the table the trigger is placed on, even if you try workarounds calling stored procedure's etc. Informix might allow you to create the trigger, but it will result in a runtime error once it figures out it re-visits the same table. Probably has the same cause as the weary thing that you can't do INSERT INTO table SELECT ... FROM table. Let's hope they wake up sometime in Menlo Park. Frido ------------------------------------------------------------------------ - Frido van Orden FAA Partners BV Planetenbaan 117 3606 AK Maarssen The Netherlands Phone: +31-346-587076 Fax: +31-346-587086 Email: fridoo@faapartners.com ------------------------------------------------------------------------ - } -----Original Message----- } From: tjordan@med.osd.mil [SMTP:tjordan@med.osd.mil] } Sent: Wednesday, October 01, 1997 8:02 PM } To: informix-list@rmy.emory.edu } Subject: Insert Trigger Problem } } I have several tables which must be tracked by a process } management system. Whenever a new record is inserted into one of these } key } record tables, I want to insert a record into the process tracking } table, } which will assign a serial number automatically (SERIAL } datatype). That is simple enough, but the catch is, I need the process } serial number to be in the key record tables when all is said and } done. } This causes problems because SQL isn't going to let me reference the } triggering table in any triggered statement or procedure. } } I tried using the BEFORE clause on the CREATE TRIGGER statement, } inserting the process tracking record before the insert of the key } record } actually occurs, but then I can't figure out how to put the process } serial value in the key record before the insert occurs. Is there some } syntax that will allow me to reference fields in the record that is } about } to be written to the key record (triggering) table? } } I'd rather not have to split this process up and do it } programmatically } in PowerBuilder, I want the insert trigger to be able to complete the } cycle, if at all possible. Changes to the table structure are } possible, } since this is in the early design stage. } } Thanks in advance... } } TJ } } -------------------==== Posted via Deja News } ====----------------------- } http://www.dejanews.com/ Search, Read, Post to Usenet