db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Morten Mikkelsen <mortenbr...@gmail.com>
Subject Re: Create Trigger .. Please help
Date Wed, 23 Jun 2010 05:49:33 GMT
Hi.
I have no clue how to help you, I just wanted to let you know that all
of your messages are well received.
Hope you sort things out.
/Morten

On Wed, Jun 23, 2010 at 6:59 AM, Mamatha Kodigehalli Venkatesh
<Mamatha.Venkatesh@ness.com> wrote:
> Hello,
>
>
>
> Derby version = db-derby-10.5.1.1
>
>
>
> I need to pick up the value of myTable.size as soon as the record is
> inserted and need to update the targetable.size column
>
> Where myTable .myTableID = targetable.MyTableID using a Trigger.
>
>
>
> Please help me out on this.
>
>
>
> CREATE TABLE myTable (
>
> myTableID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1,
> INCREMENT BY 1),
>
> Name     VARCHAR (50),
>
> size INTEGER NOT NULL);
>
>
>
> INSERT INTO myTable (name,size) VALUES ('Jon231232', 9);
>
> INSERT INTO myTable (name,size) VALUES ('Mamatha', 7);
>
> INSERT INTO myTable (name,size) VALUES ('Star', 4);
>
>
>
>
>
> CREATE TABLE targetTable (
>
> targetTableID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1,
> INCREMENT BY 1),
>
> myTableID INTEGER NULL,
>
> size INTEGER);
>
>
>
> Thanks
>
> Mamatha



-- 
/Morten

Mime
View raw message