Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 9EC61476493 for ; Thu, 9 Jan 2003 19:48:04 -0500 (EST) Received: from cr1.cristorei.net.br (host1.cristorei.com.br [200.162.160.50]) by postgresql.org (Postfix) with ESMTP id 5C6B947643B for ; Thu, 9 Jan 2003 19:48:03 -0500 (EST) Received: from mauricio1 ([200.162.160.203] unverified) by cr1.cristorei.net.br with Microsoft SMTPSVC(5.0.2195.4905); Thu, 9 Jan 2003 22:48:04 -0200 Message-ID: <010901c2b841$f429f290$830101c0@mauricio1> From: =?iso-8859-1?Q?Maur=EDcio_Sessue_Otta?= To: Subject: Getting sequence value after inserting many rows at a time Date: Thu, 9 Jan 2003 22:48:11 -0200 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0106_01C2B831.3003D120" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2720.3000 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-OriginalArrivalTime: 10 Jan 2003 00:48:04.0626 (UTC) FILETIME=[EF41FF20:01C2B841] X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/143 X-Sequence-Number: 11008 This is a multi-part message in MIME format. ------=_NextPart_000_0106_01C2B831.3003D120 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, I have a PHP script that do something like this: INSERT INTO table_with_sequence (field1, field2...., fieldn)=20 SELECT field1, field2, ..., fieldn FROM table,table=20 WHERE condition, condition My doubt: Will the rows just inserted in "table_with_sequence" always be sequencial? (won't it happen to have X rows from this INSERT, 1 rows from another INSERT in the middle and the rest rows of the first INSERT?) How can I safely get the first value the INSERT "generated" for=20 the sequence? []'s Mauricio ------=_NextPart_000_0106_01C2B831.3003D120 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi,
 
I have a PHP script that do something like= =20 this:
 
INSERT INTO table_with_sequence (field1,= =20 field2...., fieldn)
SELECT field1, field2, ..., fieldn FROM ta= ble,table=20
WHERE condition, condition
 
My doubt:
Will the rows just inserted in=20 "table_with_sequence" always be sequencial?
(won't it happen to have X rows from = this=20 INSERT, 1 rows from another INSERT
in the middle and the rest rows of the fir= st=20 INSERT?)
 
How can I safely get the first value the= =20 INSERT "generated" for
the sequence?
 
[]'s Mauricio
------=_NextPart_000_0106_01C2B831.3003D120--