db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Øystein Grøvlen <Oystein.Grov...@Sun.COM>
Subject Re: Workaround needed for nested trigger problem ERROR 54038
Date Fri, 04 Jan 2008 07:48:02 GMT
Peder Hultin wrote:
> Can someone recommend a way to update a timestamp field on insert and 
> update and not get caught in this trap, without referencing CURRENT 
> TIMESTAMP in insert or update SQL? I suspect this might not be possible. 
> Any creative thinking much appreciated.  Below is the DDL and SQL I'm 
> using.

I think a work-around is to limit the trigger to only fire on updates to 
all columns except the timestamp column.  To do this you have to list 
all columns for which the update should cause the trigger to fire:

CREATE TRIGGER trig AFTER UPDATE OF column1, column2, ... ON tab ...

I have not tried this myself, but hopefully it should prevent the recursion.

--
Øystein

Mime
View raw message