Re: Serial ID from PUT
Posted in 1997
"Mark D. Stock" <marks@west.co.za> wrote: :Daniel Wright wrote: :> :> simply stated :> we declared an insert cursor, however we need to know the serial key :> assigned to the record we just inserted. :> :> Since the record is not actually inserted until the close cursor (for :> the insert cursr), can we also use SQLCA.SQLERRD[2] for the v;ue of the :> serial key :> :> It seems we can't; is there a way around this, other than INSERTing, w/o :> an insert cursor. :> :> Efficiency is very important in this case/ :No you cannot do this. But you can still use a prepared statement. :Instead :of declaring a cursor for the INSERT statement, EXECUTE the prepared :statement USING the appropriate variables. No buffering, but still :better performance than hard-coded INSERTs. :Hope that helps, :-- The Wilcoxon's solution using a flush after the put statement will give you the right serial value and better performance than a prepared insert statement (i believe, it's a long time since I measured it). Nils.Myklebust@idg.no NM Data AS, P.O.Box 9090 Gronland, N-0133 Oslo, Norway My opinions are those of my company The Informix FAQ is at http://www.iiug.org