From derby-user-return-12910-apmail-db-derby-user-archive=db.apache.org@db.apache.org Tue Jun 22 10:51:16 2010 Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 66816 invoked from network); 22 Jun 2010 10:51:16 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 22 Jun 2010 10:51:16 -0000 Received: (qmail 27297 invoked by uid 500); 22 Jun 2010 10:51:15 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 27099 invoked by uid 500); 22 Jun 2010 10:51:13 -0000 Mailing-List: contact derby-user-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Discussion" Delivered-To: mailing list derby-user@db.apache.org Received: (qmail 27092 invoked by uid 99); 22 Jun 2010 10:51:12 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Jun 2010 10:51:12 +0000 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=AWL,HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of Mamatha.Venkatesh@ness.com designates 59.145.150.86 as permitted sender) Received: from [59.145.150.86] (HELO mail7.ness.com) (59.145.150.86) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Jun 2010 10:51:06 +0000 Received: from unknown (HELO INBLRNT11.ness.com) ([192.168.105.65]) by mail7.ness.com with ESMTP; 22 Jun 2010 16:20:38 +0530 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01CB11F8.A56D2963" Subject: derby Trigger to update column Date: Tue, 22 Jun 2010 16:20:40 +0530 Message-ID: In-Reply-To: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: derby Trigger to update column Thread-Index: AcsN34lnv99MqP61QOeaW6MreSulGAA6ybCQAMuBJvA= References: From: "Mamatha Kodigehalli Venkatesh" To: "Derby Discussion" This is a multi-part message in MIME format. ------_=_NextPart_001_01CB11F8.A56D2963 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello, =20 Derby version =3D db-derby-10.5.1.1 =20 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=20 Where myTable .myTableID =3D targetable.MyTableID using a Trigger. =20 Please help me out on this. =20 CREATE TABLE myTable ( myTableID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, = INCREMENT BY 1), Name VARCHAR (50), size INTEGER NOT NULL); =20 INSERT INTO myTable (name,size) VALUES ('Jon231232', 9); INSERT INTO myTable (name,size) VALUES ('Mamatha', 7); INSERT INTO myTable (name,size) VALUES ('Star', 4); =20 =20 CREATE TABLE targetTable ( targetTableID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH = 1, INCREMENT BY 1), myTableID INTEGER NULL, size INTEGER); =20 Thanks Mamatha ------_=_NextPart_001_01CB11F8.A56D2963 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

Hello,

 

Derby version =3D 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 =3D 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

=
------_=_NextPart_001_01CB11F8.A56D2963--