Question on Multi-Table Inserts
От | Don Parris |
---|---|
Тема | Question on Multi-Table Inserts |
Дата | |
Msg-id | CAJ-7yokqa4Aynm85LRDR1yofU-yFXLLqYJvk8Dp57RNxz97hpQ@mail.gmail.com обсуждение исходный текст |
Ответы |
Re: Question on Multi-Table Inserts
Re: Question on Multi-Table Inserts |
Список | psycopg |
Hi all,
This is more of a strategic question. If I want to enter a particular financial transaction in my DB, I need to use the following process:
Insert a new or select an existing payeeThis is more of a strategic question. If I want to enter a particular financial transaction in my DB, I need to use the following process:
BEGIN
INSERT into table payee(values...)
INSERT into table transrec(values...) # pass in payee_id variable
SELECT *from category (to get cat_id)
INSERT into table transdetails(values...) #pass in transrec_id and cat_id variables
INSERT into table transdetails(values...) #pass in transrec_id and cat_id variables
COMMIT
Or is it more complicated than that?
Thanks!
Don
--
D.C. Parris, FMP, Linux+, ESL Certificate
Minister, Security/FM Coordinator, Free Software Advocate
D.C. Parris, FMP, Linux+, ESL Certificate
Minister, Security/FM Coordinator, Free Software Advocate
GPG Key ID: F5E179BE
В списке psycopg по дате отправления: