Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 6621 invoked from network); 12 Apr 2006 20:40:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 12 Apr 2006 20:40:32 -0000 Received: (qmail 71768 invoked by uid 500); 12 Apr 2006 20:40:31 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 71736 invoked by uid 500); 12 Apr 2006 20:40:30 -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 71723 invoked by uid 99); 12 Apr 2006 20:40:30 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Apr 2006 13:40:30 -0700 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=DATE_IN_PAST_12_24,RCVD_IN_BL_SPAMCOP_NET,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of legolas.w@gmail.com designates 64.233.184.236 as permitted sender) Received: from [64.233.184.236] (HELO wproxy.gmail.com) (64.233.184.236) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Apr 2006 13:40:29 -0700 Received: by wproxy.gmail.com with SMTP id i32so1446201wra for ; Wed, 12 Apr 2006 13:40:08 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:user-agent:mime-version:to:subject:content-type:content-transfer-encoding; b=bFxJBWbSumKVMbUsNlKE1j3tp+ZonXTJOQKJ/Ac/1Y2MhFAsip84x2/vuSz89vkBiHrYtn/5DFlT9XI5DdmxOVq7C15alzqQIqR5ZcN0VWcTmiRKv2llNJ6ZNTZVSXFx6ZnHLKKAEFRFTOmeMfdx4IlO19m1eDojiXvJ6rQPnB4= Received: by 10.65.105.11 with SMTP id h11mr5664275qbm; Wed, 12 Apr 2006 13:40:08 -0700 (PDT) Received: from ?62.60.184.106? ( [62.60.184.106]) by mx.gmail.com with ESMTP id q17sm2028022qbq.2006.04.12.13.40.04; Wed, 12 Apr 2006 13:40:07 -0700 (PDT) Message-ID: <443CAEC8.3000406@gmail.com> Date: Wed, 12 Apr 2006 12:09:52 +0430 From: Legolas Woodland User-Agent: Thunderbird 1.5 (Windows/20051201) MIME-Version: 1.0 To: Derby Discussion Subject: How to find master record primary key to use it in inserting details records Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi Thank you for reading my post I have two tables which are related to eachother using a column (master details) my problem is that master table primary key is auto increment so when i insert a recoed to it i can not determine the primary key value so i do not know the key , Now my problem is that how i can find the primary key of master record to use it when i inert details records ? I should say that it is a very high hit application , before i post this message i though that i can execute a query and select latest inserted record but latest inserted record could be from another user not the current user. Thanks