Peter Bowman wrote:
> 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.
This is a bug, I see it on a simple trigger example. Am looking into
what the cause is.
Dan.
|