Re: currval bug??

From: Kris Jurka <books(at)ejurka(dot)com>
To: Gabriele Carteni <gabriele(dot)carteni(at)unile(dot)it>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: currval bug??
Date: 2004-12-21 19:57:58
Message-ID: Pine.BSO.4.56.0412211454230.12456@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Tue, 21 Dec 2004, Gabriele Carteni wrote:

> my problem is to retrieve the last autogenerated key after an insert
> statement. i always used this method (mashing queries together where the
> last is a currval query). What i should use to have the same result in
> pgsql8?
>

Well, as I mentioned in my previous email, I'm not sure if this is an
error in the JDBC driver. We could conceivably return the first result
found from a combined query like you've shown. I'm not sure what the code
implications are, but it seems like a reasonable thing to do from an
interface perspective.

To get this working with the current code you will probably have to split
it up into individual queries. In my previous email I also mentioned that
using Statement.execute() instead of Statement.executeQuery() might work,
but I've not tested it.

Kris Jurka

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Jerome Colombie 2004-12-21 21:19:11 CallableStatement: java.sql.Types=12 however type java.sql.Types=1111 was registered
Previous Message Gabriele Carteni 2004-12-21 19:11:20 Re: currval bug??