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

Re: getting primary key values for inserted records?

From: Guido Fiala <guido(dot)fiala(at)dka-gmbh(dot)de>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: getting primary key values for inserted records?
Date: 2004-01-28 13:46:26
Message-ID: 200401281446.26641.guido.fiala@dka-gmbh.de (view raw or flat)
Thread:
Lists: pgsql-jdbc
Am Dienstag, 27. Januar 2004 22:26 schrieben Sie:
> > If you don't mind running two statements, you can select the next value
> > from the sequence and then put it in your insert statement.  Like this:
> >
> > $pkey = "SELECT nextval('sequence_name')";
> > "INSERT INTO table (id, ...) VALUES ($pkey, ...)";
> >

Yup! That is just fine, many thanks!

In response to

pgsql-jdbc by date

Next:From: Guido FialaDate: 2004-01-28 13:52:23
Subject: setQueryTimeOut(1) - not expected result...
Previous:From: Dave CramerDate: 2004-01-28 13:13:50
Subject: Re: a little disillusioned now tomcat 5

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