db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel John Debrunner <...@apache.org>
Subject Re: [jira] Commented: (DERBY-1603) ERROR 54038: "Maximum depth of nested triggers was exceeded" occurs when trigger fires after upating 10.1.2.5 jars to 10.1.3.1
Date Mon, 07 Aug 2006 15:25:03 GMT
Kathey Marsden wrote:

> Kathey Marsden wrote:
> 
>> Kathey Marsden wrote:
>>
>>>>
>>> A few questions/concerns  on this issue:
>>> 1)  CORRECT TRIGGER DEFINITION:
>>
>>
>>
> I think this is it.  To update the timestamp when info is updated we do
> this:

> 0 rows inserted/updated/deleted
> ij> CREATE TRIGGER UPDATE_TEST
>  AFTER UPDATE ON TEST
>  REFERENCING OLD AS OLD
>  FOR EACH ROW MODE DB2SQL
>  UPDATE TEST SET TIMESTAMP = CURRENT_TIMESTAMP WHERE
>  TESTID = OLD.TESTID AND INFO != OLD.INFO ;
> 0 rows inserted/updated/deleted

The trigger can also be defined to only fire on update of certain
columns, e.g.

AFTER UPDATE ON TEST(INFO)

Then I think this would lead to a simpler action statement of

UPDATE TEST SET TIMESTAMP = CURRENT_TIMESTAMP WHERE TESTID = OLD.TESTID

A statement trigger might be best in this case, would result in a single
update statement rather than N.

Dan.





Mime
View raw message