Received: from mx99.openu.ac.il (arbel.openu.ac.il [147.233.32.4]) by hub.org (8.9.3/8.9.3) with ESMTP id DAA24208 for ; Mon, 7 Jun 1999 03:28:32 -0400 (EDT) (envelope-from herouth@oumail.openu.ac.il) Received: from talmon.openu.ac.il (talmon.openu.ac.il [147.233.32.11]) by mx99.openu.ac.il (Postfix) with ESMTP for id 1FD7B4B512; Mon, 7 Jun 1999 10:28:25 +0300 (IDT) Received: from [147.233.159.109] (mac-herouth.pc.openu.ac.il) by talmon.openu.ac.il (Netscape Messaging Server 3.54) with ESMTP id AAA9C9; Mon, 7 Jun 1999 10:31:00 +0300 X-Sender: herouth@shaked.cc.openu.ac.il Message-Id: In-Reply-To: <199906070647.JAA08463@omega.bkc.lv> References: <551413BBBB03D111BF880060B01AACCE0B38FA@home.priority.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Mon, 7 Jun 1999 10:29:17 +0300 To: emils@mail.usis.bkc.lv, From: Herouth Maoz Subject: Re: [SQL] Getting primary key from insert statement At 12:51 +0300 on 07/06/1999, Emils Klotins wrote: > > Wouldn't it be simpler just to SELECT the next value from the sequence >BEFORE the insert and > use it in the INSERT statement directly? Then you have to have a transaction around the two operations. And by the time you do the select, someone may lock the table where you insert. It's a potential for deadlock. Herouth -- Herouth Maoz, Internet developer. Open University of Israel - Telem project http://telem.openu.ac.il/~herutma