Re: Getting serial value of just inserted record
Posted in 1997
[This followup was posted to comp.databases.informix and a copy was sent to the cited author.] In article <346B6CE0.271@4mate.hr>, bonzi@4mate.hr says... > > 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. > > > > > > Many thnks for your help > > > > > > Andreas > > > > sqlca.sqlerrd[1] (C syntax), SQLCA.SQLERRD[2] (NewEra and, presumably, > > 4GL). Some development tools have their own syntax (e.g. JAM & Prolifics > > @dmserial). > > > > HTH > > > > Dragi "Bonzi" Raos > > Andreas To get the Serial value after an insert use the following Define Value Integer; Let Value = dbinfo("sqlca.sqlerrd1"); This will set Value to be the value of the last Serial column inserted. Hope this helps. Michael J. Erickson