Re: Get the last inserted id

Поиск
Список
Период
Сортировка
От Andrew Sullivan
Тема Re: Get the last inserted id
Дата
Msg-id 20080411175744.GA29043@crankycanuck.ca
обсуждение исходный текст
Ответ на Get the last inserted id  ("Nacef LABIDI" <nacef.l@gmail.com>)
Список pgsql-sql
On Fri, Apr 11, 2008 at 07:23:04PM +0200, Nacef LABIDI wrote:
> Hi all,
> 
> I was wondering if postgres can return the last ID inserted for a table
> which the primary key is autoincremented. I need to retrieve this ID in my
> code to continue processing on that inserted row.

Use select currval() on the sequence name.

A


В списке pgsql-sql по дате отправления:

Предыдущее
От: "A. Kretschmer"
Дата:
Сообщение: Re: Get the last inserted id
Следующее
От: Emi Lu
Дата:
Сообщение: export CSV file through Java JDBC