Skip site navigation (1) Skip section navigation (2)

JDBC and getting just assigned serial number

From: Christoph Steinbeck <steinbeck(at)ice(dot)mpg(dot)de>
To: pgsql-interfaces(at)postgreSQL(dot)org
Subject: JDBC and getting just assigned serial number
Date: 1999-09-13 19:19:18
Message-ID: 37DD4E36.830C04BD@ice.mpg.de (view raw or flat)
Thread:
Lists: pgsql-interfacespgsql-sql
Hi, 

I'm thrilled to see that there is some kind of discussion running in the
C area on the exact equivalent of my very recent JDBC problem. 
I insert a row into a table where one field is a SERIAL. This SERIAL, of
course, is automatically assigned by PostgreSQL. How do I get this
number immeadiately after inserting the row? When I issue the command
with psql I get back some kind of number which presumably is the OID.
Getting just this one would be fine too because I need it for
referencing. 

Any hints are greatly appreciated. 

TIA and cheers, 

Chris
--
Dr. Christoph Steinbeck (http://www.ice.mpg.de/~stein)
MPI of Chemical Ecology, Tatzendpromenade 1a, 07745 Jena, Germany
Tel: +49(0)3641 643644 - Mobile: +49(0)177 8236510 - Fax: +49(0)3641
643665

What is man but that lofty spirit - that sense of enterprise. 
... Kirk, "I, Mudd," stardate 4513.3..

In response to

Responses

pgsql-interfaces by date

Next:From: Theofilu AndreasDate: 1999-09-13 20:11:53
Subject: Still have problem with single quotation mark
Previous:From: Theofilu AndreasDate: 1999-09-13 19:02:34
Subject: RE[2]: [INTERFACES] ecpg and getting just assigned serial number

pgsql-sql by date

Next:From: Michael GreenDate: 1999-09-13 23:35:41
Subject: Postgres Table grows very quickly?
Previous:From: Theofilu AndreasDate: 1999-09-13 19:02:34
Subject: RE[2]: [INTERFACES] ecpg and getting just assigned serial number

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group