db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michelle Caisse <Michelle.Cai...@Sun.COM>
Subject Re: Derby Trigger Query
Date Mon, 10 Apr 2006 22:22:41 GMT
See http://issues.apache.org/jira/browse/DERBY-443 and 
http://issues.apache.org/jira/browse/DERBY-759.  There is an issue 
handling OutOfMemoryExceptions that can result in this error.

-- Michelle

Peter Bowman wrote:

> Hi Dan,
>
> Thanks for your input. Since I first posted I tried the solution you 
> suggested but I always got:
>
> "ERROR 40XT0: An internal error was identified by RawStore module."
>
> I've checked everything ove many times to ensure that my statement is 
> correct and I believe it is, so is there any other reason for this error.
>
> Thanks,
>
> Peter.
>
>> From: Daniel John Debrunner <djd@apache.org>
>> Reply-To: "Derby Discussion" <derby-user@db.apache.org>
>> To: Derby Discussion <derby-user@db.apache.org>
>> Subject: Re: Derby Trigger Query
>> Date: Mon, 10 Apr 2006 10:40:21 -0700
>>
>> Peter Bowman wrote:
>>
>> > Hi All,
>> >
>> > I have a trigger like:
>> >
>> > DROP TRIGGER RULE_10A;
>> >
>> > CREATE TRIGGER RULE_10A
>> >     AFTER INSERT ON PLAN_NAME_TABLE
>> >     REFERENCING NEW AS NEWROW
>> >     FOR EACH ROW MODE DB2SQL
>> >     INSERT INTO PLAN_NUTRIENT_TABLE (PLAN, NUTRIENT, NUTRIENT_TYPE,
>> > UNITS) VALUES (NEWROW.PLAN, 'Total Fat', 'Fat', 'g');
>> >
>> >
>> > which inserts a new row into a table whenever a new row is inserted 
>> into
>> > another table, but is it possible to use a single trigger to insert
>> > several rows into the same table or do I have to write a separate
>> > trigger for each insert.
>>
>> No. The VALUES clause supports multiple rows.
>>
>> INSERT INTO PLAN_NUTRIENT_TABLE (PLAN, NUTRIENT, NUTRIENT_TYPE,UNITS)
>> VALUES (NEWROW.PLAN, 'Total Fat', 'Fat', 'g'),
>>        (NEWROW.PLAN, 'Marmite', 'Vitamin B', 'mg');
>>
>> See
>>
>> http://db.apache.org/derby/docs/10.1/ref/rrefsqlj11277.html
>>
>> Dan.
>>
>>
>>
>
>


Mime
View raw message