Getting back the primary key after INSERT

From: "Scott W(dot) Hill" <shill(at)verisign(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Getting back the primary key after INSERT
Date: 2001-10-22 20:40:28
Message-ID: 06F9B658-C72D-11D5-9984-003065BDABEC@verisign.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

I'm pretty new with JDBC and Postgres. Here's my question:

I have a table with an automatically incrementing key. I'm inserting
things into the table via an INSERT statement from JDBC. Once I do the
INSERT, I want to know what new number was assigned by the database to
the row that I just inserted. Any ideas?

--Scott

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Mihai Gheorghiu 2001-10-22 21:23:49 Re: Problems setting up PostgreSQL and Tomcat JDBC connection
Previous Message Travis Hoyt 2001-10-22 19:41:20 views, with check option