Hi, tanks a lot, that worked fine! Only that I can not find any reference to that syntax in the maxdb manual, maybe there should be a correction...
Thanks all for the prompt help! Tobias Dittrich Am Dienstag, 13. Juli 2004 09:55 schrieb Anhaus, Thomas: > Tobias Dittrich wrote : > >Hi, > > > >I have seen this question asked before on this list, but > >unfortunately the answer deviated a bit from the > > original question - or maybe I just did not understand > > the answer good enough, this is the first time I try > > with triggers and such. > > > >I want to do something like copy the behaviour of the > > mysql TIMESTAMP. That is: the timestamp column holds > > the date (and time) of the last modification of the > > corresponding data row. As I understand for INSERT this > > can be achieved by setting the default column value to > > TIMESTAMP. > > > >For UPDATE the simple aproach: > >CREATE TRIGGER TEST_TIMESTAMP FOR TEST AFTER UPDATE > > EXECUTE ( > >UPDATE USER.TEST SET DATUM=TIMESTAMP WHERE > > TEST.ID=:NEW.ID; ) > >does not work. This causes the db kernel to crash every > > time I execute an update on the table - presumably > > because of an endless recursion of the trigger? > > > >But what would be the right aproach to this problem? > > > >Many thanks in advance > > > >Tobias Dittrich > > > > > >-- > >MaxDB Discussion Mailing List > >For list archives: http://lists.mysql.com/maxdb > >To unsubscribe: > >http://lists.mysql.com/maxdb?>[EMAIL PROTECTED] > >m > > Your solution definitely codes an endless recursion, > which causes an stack overflow which crashes the kernel. > To avoid the endless recursion please add the ignore > trigger option to your update statement : > > UPDATE USER.TEST SET DATUM=TIMESTAMP WHERE > TEST.ID=:NEW.ID IGNORE TRIGGER; > > Best Regards, > Thomas -- Tobias Dittrich - Internet-Entwicklung - __________________________ WAVE Computersysteme-GmbH Philipp-Reis Str. 1 35440 Linden Tel.: +49 (0)6403 / 9050 - 6001 Fax: +49 (0)6403 / 9050 - 5089 mailto: [EMAIL PROTECTED] http://www.wave-computer.de -- MaxDB Discussion Mailing List For list archives: http://lists.mysql.com/maxdb To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]
