Re: Getting serial value of just inserted record
Posted in 1997
On 13 Nov 1997, AndreasSeibt wrote: > I have to write a stored procedure which inserts a record into a table. > This record has a field of Type SERIAL as primary key. I need the value of > the primary key directly after inserting the record for subsequent > processing. Is there any way to get this value? > > I use INFORMIX-Online 7.23. So, are you writing a stored procedure (SPL), or are you using I4GL, NewEra or ESQL/C? The answer varies. In SPL, you use DBINFO(); in the others you use the SQLCA record (but you use different array indices to get at the info in ESQL/C as compared with I4GL or NewEra). I expect there are also some auxilliary methods if you're using one of the class libraries in NewEra, but you'd have to read the manual just the same as I would. Yours, Jonathan Leffler (johnl@informix.com) #include <witticism.h>