db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From FNG <daniel8but...@googlemail.com>
Subject triggers / referencing clause
Date Tue, 05 Jan 2010 20:55:04 GMT

--This trigger compiles and works fine
CREATE TRIGGER seq_table_x_trg AFTER INSERT ON TABLE_X REFERENCING NEW ROW
AS new FOR EACH ROW MODE DB2SQL 
UPDATE sequences SET currval = currval + 1 WHERE sequence_name = 'table_x'; 

--If I add this additional clause on the end then it seems to complain about
"new"
SET new.PK = 'abc-' || SELECT currval FROM sequences WHERE sequence_name =
'table_x’;

If anyone can comment would be appreciated.
-- 
View this message in context: http://old.nabble.com/triggers---referencing-clause-tp27026717p27026717.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.


Mime
View raw message