Lou,
On Wed, Mar 6, 2019 at 12:36 PM Lou <lou@dayspringpublisher.com> wrote:
> The data for both tables needs to be saved at the same time so that the id number of table c can be copied into the
c_idfield of table p.
I think what you want to do is use a transaction (BEGIN), insert the
data into table c RETURNING id, then insert the data into table p
using the id returned from the first query. If there were no errors,
COMMIT the transaction, otherwise ROLLBACK. It's two queries, but
because of the transaction, it's happening atomically within the
database.
Cheers,
Chris
--
Christopher Swingley
Fairbanks, Alaska
http://swingleydev.com/
cswingle@swingleydev.com