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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-jdbc by date

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