Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 2B71A475843 for ; Tue, 27 Aug 2002 23:41:27 -0400 (EDT) Received: from www.cdrbill.com (cpe-gan-68-101-90-90-cmcpe.ncf.coxexpress.com [68.101.90.90]) by postgresql.org (Postfix) with ESMTP id 67B2847580B for ; Tue, 27 Aug 2002 23:41:26 -0400 (EDT) Received: from jaguar.cdrbill.com (lynx [192.168.0.6]) by www.cdrbill.com (8.11.6/8.11.6) with ESMTP id g7S3fNg04494 for ; Tue, 27 Aug 2002 23:41:24 -0400 Content-Type: text/plain; charset="us-ascii" From: Chris Ruprecht To: pgsql-php@postgresql.org Subject: How do I get a recid value from a just inserted record Date: Tue, 27 Aug 2002 23:45:27 -0400 User-Agent: KMail/1.4.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200208272345.27536.chrup@earthlink.net> X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200208/89 X-Sequence-Number: 1434 Hi all, I have 3 tables (extremely simplified): a: a.recid default sequence_a a.name b: b.recid default sequence_b b.address b.city c: c.recid default sequence_c c.arecid c.brecid each has a default sequence on their respective recid - which is the primar= y=20 index. when I do an "insert into a ...", it automagically assigns recid a new, uni= que=20 value, same goes for b. But to create c, I need to know the recid from a and b, so I can connect th= e=20 two. Is there any way to get the recid from a and b after they have been inserte= d=20 like in "insert into a ... and give me the recid you're going to use, back"? I know, I can do a "netxval('...')" stuff and then insert the records with= =20 values in recid, but that requires two extra calls to the DB per transactio= n. Best regards, Chris