| От | Martijn van Oosterhout |
|---|---|
| Тема | Re: Getting OID after Insert |
| Дата | |
| Msg-id | 20011019010545.J7364@svana.org обсуждение |
| Ответ на | Getting OID after Insert (Bruce Cota <bruce@vivi.com>) |
| Список | pgsql-general |
On Wed, Oct 17, 2001 at 11:18:44PM -0400, Bruce Cota wrote: > Is there a way, in SQL, to access the oid of the row created > by an immediately preceding insert statement? > > e.g. > > insert into t (x, y) values (1, 2); > > select * from t where oid = <what goes here?> > > Thanks for any advice. Yeah, the is a getlastoid function. sequences, nextval, currval and lastval are a better bet though. -- Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/ > Magnetism, electricity and motion are like a three-for-two special offer: > if you have two of them, the third one comes free.
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера