db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thiyagu P" <thiy...@gmail.com>
Subject Trigger function broken in 10.4.1.3?
Date Tue, 10 Jun 2008 14:16:58 GMT
Hi,

Getting null pointer exception when a trigger gets invoked.

Steps to recreate :
1. Created new db and execute the following stmts
2. CREATE TABLE TRADE(
      ID INT PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY (START WITH 1000),
      BUYID INT NOT NULL,
      QTY FLOAT(2) NOT NULL
   );

   CREATE TABLE TOTAL(BUYID INT NOT NULL, TOTALQTY FLOAT(2) NOT NULL);

   CREATE TRIGGER TRADE_INSERT
     AFTER INSERT ON TRADE
     REFERENCING NEW AS NEWROW
     FOR EACH ROW MODE DB2SQL
     UPDATE TOTAL SET TOTALQTY = NEWROW.QTY WHERE BUYID = NEWROW.BUYID;

   INSERT INTO TOTAL VALUES (1, 0);

   INSERT INTO TRADE VALUES(1, 1, 1, 10);

Same thing work fine in 10.3.3.0.


Thanks,
Thiyagu

Mime
View raw message