Re: Getting serial value of just inserted record
Posted in 1997
Jonathan Leffler <johnl@informix.com> wrote in article <64fs03$sa7@cssun.mathcs.emory.edu>... > 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. SQLCA record is fine in Newera ONLY if you use CCL/Informix connectivity. If you wish to use CCL/ODBC then no data is returned in SQLCA. > > Yours, > Jonathan Leffler (johnl@informix.com) #include <witticism.h> > >