db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bruehlicke <bruehli...@gmail.com>
Subject UPDATE TRIGGER - ERROR 42Y92: STATEMENT triggers may only reference table transition variables/tables.
Date Thu, 14 Feb 2008 04:40:05 GMT
OK new to this and I have tried quite a lot of permutations but cannot get
it work.

The following gives ERROR 42Y92: STATEMENT triggers may only reference table
transition variables/tables.

Any idea what is wrong in my TRIGGER creation ?


String testTable1 = "A";
Statement s = _connection.createStatement();

s.execute("CREATE TABLE " + testTable1 + "( ID INT NOT NULL PRIMARY KEY NOT
NULL, NAME VARCHAR(80), REMARK VARCHAR(80), LAST_UPDATED TIMESTAMP DEFAULT
CURRENT_TIMESTAMP)");

s.execute("CREATE TRIGGER A_TRIGGER AFTER UPDATE OF NAME, REMARK ON " +
testTable1 + " REFERENCING OLD AS UPDATEDROW UPDATE " + testTable1 + " SET
LAST_UPDATED=CURRENT_TIMESTAMP WHERE ID=UPDATEDROW.ID");

B-)

Mime
View raw message