Re: Retrieving Serial Value
Posted in 2000
Anil, In 4gl, immediately after the insert statement, SQLCA.SQLERRD[2] will contain the serial number of the last inserted row if the insert was successful. Otherwise it will contain the ISAM error. Regards, Sue anil kuttappan <anil_kuttappan@yahoo.com> on 06/04/2000 09:11:18 To: Informix <informix-list@iiug.org> cc: (bcc: Sue Davidson/EXE) Subject: Retrieving Serial Value Hi , I would like somebody to help me out with this. I have a table with serial column. In a multiuser environment suppose user A inserts a row inthe table and wants to retrieve the serial value for the row he just inserted, how do i get it. considering the fact that user B might have also inserted a row while user A did a select to find its value. So the question is how to retrieve the serial value for the row which User A inserted. I know locking the concerned table and doing a select to get the last value followed by an insert of a new row and a commit is one alternative, but i would like to know if there is any other way out. Thanks Anil K ===== Anil Kuttappan Mailto: anil_kuttapan@yahoo.com __________________________________________________ Do You Yahoo!? Talk to your friends online with Yahoo! Messenger. http://im.yahoo.com