Simple problem? - Mailing list pgsql-general

From Stan Jacobs
Subject Simple problem?
Date
Msg-id Pine.LNX.4.10.10003012309200.7831-100000@dev.jtek.com
Whole thread Raw
Responses Re: [GENERAL] Simple problem?
List pgsql-general
Hi there,

I must be confusing my syntax somehow, because I'm having trouble doing a
simple update with returned id...  As in.... I have two tables: an order
table and an orderitems table.  I need to write the order record, then use
the order_id from the order record in the insert to the orderitems record.

1. Can I use a transaction begin/end for the entire transaction if I need
to get the order_id in between the two writes?

2. How do I get the order_id from the record I just wrote?


    thanks in advance.

        -sj




pgsql-general by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [GENERAL] psql 7.0.0 beta
Next
From: Wim Aarts
Date:
Subject: Re: [GENERAL] Re: "LockRelease: locktable lookup failed, no lock"