X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 90F0A537AB for ; Fri, 1 Apr 2005 01:33:42 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 23062-08 for ; Fri, 1 Apr 2005 00:33:34 +0000 (GMT) Received: from hosting.commandprompt.com (128.commandprompt.com [207.173.200.128]) by svr1.postgresql.org (Postfix) with ESMTP id 1FF2953797 for ; Fri, 1 Apr 2005 01:33:33 +0100 (BST) Received: from 192.168.1.52 (fc1smp [66.93.38.87]) by hosting.commandprompt.com (8.12.8/8.12.8) with ESMTP id j310Twkh021225; Thu, 31 Mar 2005 16:29:59 -0800 Subject: Re: getGeneratedKeys() From: "Joshua D. Drake" Reply-To: jd@commandprompt.com To: Jamie Deppeler Cc: pgsql-general@postgresql.org In-Reply-To: <424C9067.2030405@doitonce.net.au> References: <424C9067.2030405@doitonce.net.au> Content-Type: text/plain Organization: Joshua D. Drake Date: Thu, 31 Mar 2005 16:33:31 -0800 Message-Id: <1112315611.30190.22.camel@jd2.commandprompt.com> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 (2.0.2-3) Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.031 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200504/3 X-Sequence-Number: 75916 On Fri, 2005-04-01 at 10:05 +1000, Jamie Deppeler wrote: > Hi to all, > > I have one problem with PostgreSQL and Java. I have a table with Primary > key(serial) field, but after I insert a record i am unable to retrieve > this value. I have tried getGeneratedKeys() and i get nothing returned. I am not a Java programmer but normally I would use select currval ('sequencename'); > > There is another method to retrieve this field? > > thanks > > > ---------------------------(end of broadcast)--------------------------- > TIP 6: Have you searched our list archives? > > http://archives.postgresql.org -- Command Prompt, Inc., Your PostgreSQL solutions company. 503-667-4564 Custom programming, 24x7 support, managed services, and hosting Open Source Authors: plPHP, pgManage, Co-Authors: plPerlNG Reliable replication, Mammoth Replicator - http://www.commandprompt.com/