Re: SQLCA.SQLERRD returns zero after PUT [24158]
Posted in 2011
You cannot track the serial values assigned to individual rows when you use an INSERT CURSOR and PUT multiple rows to the cursor before it is flushed. At the time the buffer is flushed, so when it fills or when you execute a "FLUSH cursorname;" statement, sqlca will return the serial number assigned to the last row in the buffer at the time. If you need the serial values of each row, and understandably you might, you will have to FLUSH after each PUT. That reduces the performance improvement of the INSERT CURSOR, but it's the only way. Art Art S. Kagel Advanced DataTools (www.advancedatatools.com) Blog: http://informix-myview.blogspot.com/ Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on my employer, Advanced DataTools, the IIUG, nor any other organization with which I am associated either explicitly, implicitly, or by inference. Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves. On Tue, Jun 28, 2011 at 1:28 AM, GARY GU <garyg@selectsoftware.com.au>wrote: > IDS 11.50.FC6 > 4GL 7.50.FC1 > > I would improve the current 4gl that is running with direct insert by using > declare->open->put.. > > But have a problem after PUT, if want to get the last serial no inserted > into > a table, but SQLCA.SQLERRD[2] just returns zero. > > Knowing PUT is to add rows into buffer then flush if it is full, so the > serial > no would not be generated before flush to table? any help with this? > > Thanks > > Gary > > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > --20cf3071c81256e49304a6c4dd21