Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Interfaces Jdbc > Re: Retrieving ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 1883 of 1997
Post > Topic >>

Re: Retrieving last InsertedID : INSERT... RETURNING safe ?

by spastor@[EMAIL PROTECTED] Feb 20, 2008 at 12:25 PM

Thanks Heikki !

That makes things clear to me now, i ll go on with the RETURNING method as
=
i have no restrictions in term of ****tability at all (lucky me :))

Thanks again


Cheers

Seb.



Le mer  , "Heikki Lin****angas"  a =C3=A9crit:
>spa
>stor@[EMAIL PROTECTED]
 wrote:
>> Only one exception is regarding the best method to
>retrieve the last inserted id (serial). There are many posts on this
topic
>but i couldn t find a definitive response.=20
>> I am using postgresql version 8.2.6 and jdbc  8.2_p505,
>i ve been experiencing INSERT statement with RETURNING myID, using an
>executeQuery it works great, i retrieve the proper value everytime at
least
> from the few tests i have been doin  locally.
>> Is it THAT easy or could this method break somehow in a
>live environement ?
>
>
>It is that easy, and that is a good way to do it.
>
>
>
>Alternatively, if you need to sup****t older PostgreSQL version for=20
>
>example, you could use a "SELECT currval('sequence')" query after the=20
>
>INSERT.
>
>
>
>Much of the of discussion you saw were probably about implementing the=20
>
>JDBC getGeneratedKeys() function that some applications need for=20
>
>****tability reasons, or because of middleware that doesn't know how to=20
>
>do INSERT RETURNING. PostgreSQL driver doesn't sup****t that at the=20
>
>moment, but as long as you don't need it, you'll be fine.
>
>
>
>--=20
>
>Heikki Lin****angas
>
>EnterpriseDB   http://www.enterprisedb.com
>
>
>=20




---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to majordomo@[EMAIL PROTECTED]
 so that your
       message can get through to the mailing list cleanly
 




 1 Posts in Topic:
Re: Retrieving last InsertedID : INSERT... RETURNING safe ?
spastor@[EMAIL PROTECTED]  2008-02-20 12:25:47 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan13V112 Thu Jul 24 1:50:57 CDT 2008.