Using trigger to set timestamp
Posted in 1999
Hello, I'm not to familiar with triggers and stored procedures. What I want to do is to stick a timestamp in every record in the database. My idea was to use two triggers for every table; one for the insert action and one for the update action. Every record has a column eg 'update_time'. I want to define the triggers in such a way that they remain working even if the table structure changes. So I don't want to mention the column names in the trigger. But this seems to be impossible. If I do an update of the table, as a consequence the update trigger is activated and should update the 'update_time' field. This will cause another update, so the update trigger is activated again. Informix prohibits this situation to happen. So my question: is what I should do to make this all happen? Again, I don't want to mention all the column names in the trigger, because that creates a dependancy that I don't want. Thanks, Henk vd Geld