Re: SQL-question: returning the id of an insert querry

Поиск
Список
Период
Сортировка
От Scott Chapman
Тема Re: SQL-question: returning the id of an insert querry
Дата
Msg-id 200311091026.51404.scott_list@mischko.com
обсуждение исходный текст
Ответ на Re: SQL-question: returning the id of an insert querry  (Martijn van Oosterhout <kleptog@svana.org>)
Ответы Re: SQL-question: returning the id of an insert querry  (Alvaro Herrera <alvherre@dcc.uchile.cl>)
Список pgsql-general
On Sunday 09 November 2003 03:13, Martijn van Oosterhout wrote:
> After you've done the insert on the address table, you can use
> currval('address_id_seq') (or equivalent) to get the ID. Ofcourse you
> have to have used nextval() for the original insert.

What if someone else inserts another address before I get the currval?
I'm out of luck then, right?



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

Предыдущее
От: Rajesh Kumar Mallah
Дата:
Сообщение: Re: Question on Select
Следующее
От: Doug McNaught
Дата:
Сообщение: Re: SQL-question: returning the id of an insert querry