RE: Update trigger object (datetime stamping records)
Posted in 2000
Topics: Triggers, Constraints & Referential Integrity
Would it be possible instead to set the fields to 'default' to 'current year to second' and 'user', rather than firing a trigger after the fact? If for some reason this is not feasible, I do have a method to trick triggers into acting on the calling object, but you're not going to like it. -----Original Message----- From: Ralph Hardy [mailto:ralphh@accessone.com] Sent: Thursday, April 27, 2000 1:58 PM Posted To: informix Conversation: Update trigger object (datetime stamping records) Subject: Update trigger object (datetime stamping records) It seems to be impossible to update the trigger object using Version 7 SE. I understand the desire to avoid infinitely nested firings of the update trigger - but isn't there a way to work around this? We want to stamp the server time and user on each record posted. I can avoid the recurrence problem by using the WHEN condition and not doing the update if the time stamp is within a second of the CURRENT datetime. Has anybody done this? Thanks in advance, Ralph
Defaults are a good idea for INSERTs - but need to handle UPDATEs. The only yet-untest-idea I had was really ugly - to insert a record into a table whose sole function is on its insert-trigger event to UPDATE the target table's datetime & user columns, then I'd have to get rid of this record. What's your method? Ralph "Scott Black" <sblack@elsouth.com> wrote in message news:8ea20f$sa6$1@news.xmission.com... > > Would it be possible instead to set the fields to 'default' to 'current > year to second' and 'user', rather than firing a trigger after the fact? > > If for some reason this is not feasible, I do have a method to trick > triggers into acting on the calling object, but you're not going to like > it. > > > > -----Original Message----- > From: Ralph Hardy [mailto:ralphh@accessone.com] > Sent: Thursday, April 27, 2000 1:58 PM > Posted To: informix > Conversation: Update trigger object (datetime stamping records) > Subject: Update trigger object (datetime stamping records) > > It seems to be impossible to update the trigger object using Version 7 > SE. > > I understand the desire to avoid infinitely nested firings of the update > trigger - but isn't there a way to work around this? > > We want to stamp the server time and user on each record posted. I can > avoid > the recurrence problem by using the WHEN condition and not doing the > update > if the time stamp is within a second of the CURRENT datetime. > > Has anybody done this? > > Thanks in advance, > > Ralph >