Re: currval bug?? - Mailing list pgsql-jdbc

From Kris Jurka
Subject Re: currval bug??
Date
Msg-id Pine.BSO.4.56.0412211454230.12456@leary.csoft.net
Whole thread Raw
In response to Re: currval bug??  (Gabriele Carteni <gabriele.carteni@unile.it>)
List 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

pgsql-jdbc by date:

Previous
From: Gabriele Carteni
Date:
Subject: Re: currval bug??
Next
From: Jerome Colombie
Date:
Subject: CallableStatement: java.sql.Types=12 however type java.sql.Types=1111 was registered