pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Joshua D. Drake <jd@commandprompt.com>
To: Jamie Deppeler <jamie@doitonce.net.au>
Cc: pgsql-general@postgresql.org
Subject: Re: getGeneratedKeys()
Date: Thu, 31 Mar 2005 16:33:31 -0800
Message-ID: <1112315611.30190.22.camel@jd2.commandprompt.com> (raw)
In-Reply-To: <424C9067.2030405@doitonce.net.au>
References: <424C9067.2030405@doitonce.net.au>

On Fri, 2005-04-01 at 10:05 +1000, Jamie Deppeler wrote:
> Hi to all,
> 
> I have one problem with PostgreSQL and Java. I have a table with Primary 
> key(serial) field, but after I insert a record i am unable to retrieve 
> this value.  I have tried getGeneratedKeys() and i get nothing returned.

I am not a Java programmer but normally I would use select currval
('sequencename');


> 
> There is another method to retrieve this field?
> 
> thanks
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
> 
>                http://archives.postgresql.org
-- 
Command Prompt, Inc., Your PostgreSQL solutions company. 503-667-4564
Custom programming, 24x7 support, managed services, and hosting
Open Source Authors: plPHP, pgManage, Co-Authors: plPerlNG
Reliable replication, Mammoth Replicator - http://www.commandprompt.com/




view thread (2+ messages)

Message-ID: <1112315611.30190.22.camel@jd2.commandprompt.com>
Permalink:  ../1112315611.30190.22.camel@jd2.commandprompt.com/
Also on:    postgresql.org/message-id/1112315611.30190.22.camel@jd2.commandprompt.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: jd@commandprompt.com, jamie@doitonce.net.au, pgsql-general@postgresql.org
  Subject: Re: getGeneratedKeys()
  In-Reply-To: <1112315611.30190.22.camel@jd2.commandprompt.com>
  References: <424C9067.2030405@doitonce.net.au> <1112315611.30190.22.camel@jd2.commandprompt.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox