db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Bowman" <petergbow...@hotmail.com>
Subject Unable To Create Multiple Row Inserting Trigger
Date Tue, 11 Apr 2006 11:06:41 GMT
Hi All,

I can create a trigger exactly like the following:

CREATE TRIGGER TEST AFTER INSERT ON PLAN_NAME_TABLE REFERENCING NEW AS 
NEWROW FOR EACH ROW MODE DB2SQL INSERT INTO PLAN_NUTRIENT_TABLE VALUES 
(NEWROW.PLAN, 'Total Fat', 'Fat', DEFAULT, 'g', DEFAULT, DEFAULT);

but if I try to insert more than a single row using the trigger, as shown 
below, I can't create it.

CREATE TRIGGER TEST AFTER INSERT ON PLAN_NAME_TABLE REFERENCING NEW AS 
NEWROW FOR EACH ROW MODE DB2SQL INSERT INTO PLAN_NUTRIENT_TABLE VALUES 
(NEWROW.PLAN, 'Total Fat', 'Fat', DEFAULT, 'g', DEFAULT, DEFAULT), 
(NEWROW.PLAN, 'Total Protein', 'Protein', DEFAULT, 'g', DEFAULT, DEFAULT);

I get a String index out of bounds error (always -8).

I've tried to find my error until I'm blue in the face, but I can't see what 
I am doing wrong.

Any ideas, thanks,

Peter.



Mime
View raw message