X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id EED70D1B449 for ; Tue, 30 Dec 2003 23:57:21 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 86086-08 for ; Tue, 30 Dec 2003 19:56:34 -0400 (AST) Received: from anchor-post-34.mail.demon.net (anchor-post-34.mail.demon.net [194.217.242.92]) by svr1.postgresql.org (Postfix) with ESMTP id B01BED1B432 for ; Tue, 30 Dec 2003 19:56:31 -0400 (AST) Received: from tmsl-adsl.demon.co.uk ([80.177.114.181] helo=bacon.tmsl.demon.co.uk) by anchor-post-34.mail.demon.net with esmtp (Exim 3.35 #1) id 1AbTiv-000IXX-0Y for pgsql-jdbc@postgresql.org; Tue, 30 Dec 2003 23:56:29 +0000 Date: Tue, 30 Dec 2003 23:56:23 +0000 From: Paul Thomas To: "pgsql-jdbc @ postgresql . org" Subject: Re: getGeneratedKeys() Message-ID: <20031230235623.A27715@bacon> References: <3FF1C0EE.4010107@dsv.su.se> <32899.213.89.23.209.1072821322.squirrel@www.dsv.su.se> <1216.192.168.0.64.1072824461.squirrel@mercury.wardbrook.com> <33309.213.89.23.209.1072826327.squirrel@www.dsv.su.se> Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=ISO-8859-1 In-Reply-To: <33309.213.89.23.209.1072826327.squirrel@www.dsv.su.se>; from henr-and@dsv.su.se on Tue, Dec 30, 2003 at 23:18:47 +0000 X-Mailer: Balsa 1.2.3 Lines: 28 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200312/201 X-Sequence-Number: 8937 On 30/12/2003 23:18 henr-and@dsv.su.se wrote: > > Can you do the insert using a function instead, and return the currval > > on the underlying sequence? > > > > John > > > > I'm not sure what you mean. A stored procedure? > > The good thing about getGeneratedKeys() is that you don't have to write > DB-specific code. I always thought that auto-generated keys _are_ db specific. Where are they defined in SQL92/99? Back to your problem: Does your app have to support different DBMSs or is it PostgreSQL-only? -- Paul Thomas +------------------------------+---------------------------------------------+ | Thomas Micro Systems Limited | Software Solutions for the Smaller Business | | Computer Consultants | http://www.thomas-micro-systems-ltd.co.uk | +------------------------------+---------------------------------------------+