Getting key value with an insert and using it in another. - Mailing list pgsql-general

From stefan
Subject Getting key value with an insert and using it in another.
Date
Msg-id HfE47.6624$oh4.724041@news20.bellglobal.com
Whole thread Raw
Responses RE: Getting key value with an insert and using it in another.  ("Dave Cramer" <Dave@micro-automation.net>)
List 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 by date:

Previous
From: IMS
Date:
Subject: AutoStart and AutoDown
Next
From: "Michael Beckstette"
Date:
Subject: how to obtain informations about current connections