Re: Next Serial value ?
Posted in 1998
Noel Griffin — — source: Informix-list mailing list archive (1991-1998)
There is no reliable way of getting the next serial value before the insert. INSERT first, then get the serial value from SQLCA.SQLERRD[2] immediatly after the insert before any other SQL is performed. You do NOT have to do a SELECT MAX(col). I do not recommend using SERIALS with Informix as most ODBC drivers do not return the new serial value with either the DAO, or RDO objects (i.e. from VB4/5), and therefore make it impossible to insert a master detail relationship type transaction where the detail records. If you find it combersome to insert, access the SQLCA.SQLERRD[2], and then update , why not write a stored procedure that will do it for you.