Getting key value with an insert and using it in another.

Поиск
Список
Период
Сортировка
От stefan
Тема Getting key value with an insert and using it in another.
Дата
Msg-id HfE47.6624$oh4.724041@news20.bellglobal.com
обсуждение исходный текст
Ответы RE: Getting key value with an insert and using it in another.  ("Dave Cramer" <Dave@micro-automation.net>)
Список pgsql-general
Hi:

I need to be able to grab a key value generated by the server so that I can
use it with other inserts within the context of a transaction.

In a nut shell, I have an order table and an order details table. When an
order is saved, it has to go into both the order table and the order detail
tables where the order details records require the key value created in the
order table.

SQL server had a function to do this (@@identity) does PostGresSql have
anything?

Thanks,

Stefan



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

Предыдущее
От: IMS
Дата:
Сообщение: AutoStart and AutoDown
Следующее
От: "Michael Beckstette"
Дата:
Сообщение: how to obtain informations about current connections