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

From: "stefan" <stefan(at)studioweb(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Getting key value with an insert and using it in another.
Date: 2001-07-16 17:05:34
Message-ID: HfE47.6624$oh4.724041@news20.bellglobal.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message stefan 2001-07-16 17:06:14 JDBC 2.0 support?
Previous Message Robert Treat 2001-07-16 16:51:29 trigger wont use internal function?