| От | Oliveiros Cristina |
|---|---|
| Тема | Re: Obtaining the primary key of the record just inserted |
| Дата | |
| Msg-id | 00c501c8223b$0dde0c90$ec5a3d0a@marktestcr.marktest.pt обсуждение исходный текст |
| Ответ на | Obtaining the primary key of the record just inserted ("Oliveiros Cristina" <oliveiros.cristina@marktest.pt>) |
| Список | pgsql-sql |
It worked perfectly.
Thanks a million, Scott.
Best,
Oliveiros
----- Original Message -----
From: "Scott Marlowe" <scott.marlowe@gmail.com>
To: "Oliveiros Cristina" <oliveiros.cristina@marktest.pt>
Cc: <pgsql-sql@postgresql.org>
Sent: Thursday, November 08, 2007 6:03 PM
Subject: Re: [SQL] Obtaining the primary key of the record just inserted
> On Nov 8, 2007 11:56 AM, Oliveiros Cristina
> <oliveiros.cristina@marktest.pt> wrote:
>>
>> Hello, All,
>>
>> I have the need to know the primary key assigned to a record I've just
>> INSERTed .
>>
>> Is there an easy way to solve this ?
>>
>> Similar to SQLServer's SELECT scope_identity() ; ?
>
> In 8.2 and up:
>
> insert into table a (info) values ('abc') returning id;
>
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера