Re: Serial ID from PUT
Posted in 1997
Topics: Performance & Tuning
This is a multi-part message in MIME format. --------------12BF3D076F17 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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, -- --------------12BF3D076F17 Content-Type: text/plain; charset=us-ascii; name="ATT_SIG.TXT" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="ATT_SIG.TXT" Mark. +------------------------------------------------------------------+ |Mark D. Stock - The West Solutions Group http://www.west.co.za | | The Informix FAQ is at http://www.iiug.org | |mailto:marks@west.co.za +-----------------------------------------+ |Tel: +27 11 803 2151 |If it doesn't work, force it! | |Fax: +27 11 803 2189 |If it breaks, it needed replacing anyway!| |Cell: +27 83 250 2325 |Well, that's how I code anyway! | +------------------------+-----------------------------------------+ --------------12BF3D076F17--