Re: VB, RDO, Informix Q:How to retrieve serial value after insert?
Posted in 1998
Topics: Connectivity: ODBC / JDBC / .NET
The Serial value from Informix is returned as part of the SQLCA.SQLERRD data structure as you realise. This is unique to Informix and as such does not fall within the ODBC specification - and is not therefore returned by generic ODBC drivers unless specifically catered for. We discussed this requirement with OPENLINK and this feature has been added to their drivers. It is therefore possible to obtain the SERIAL and ROW-ID values from an insert using the 'SQLGetStmtOption' and providing the appropriate value for 'fOption' (1049 & 1048 - I think!). Required value is then returned in '*pvParam'. This feature is not available in many ODBC drivers so if you want to use it then I would recommend that you get the Openlink drivers from (www.openlink.com). I believe the Visigenic driver also supports this feature - not aware of any others currently. Regards Kevin Hodgson On Sat, 10 Jan 1998 08:44:11 GMT, Kalkin@nojunk.earthlink.net (Kelly Ringwald) wrote: >Hi All, > >I'm developing a multi-table rdo vb ap against an informix database. >The primary recordset uses a serial key, but I need that key value in >order to insert into several related recordsets. Does anyone know how >to retrieve that value? > >Currently I am using the following kluge: Remove the sort from the >PrimaryRecordSet SQL, Refresh, Movelast, Store Key value, Add sort >back, and refresh. There must be a better way! > >I've been looking for a way to access the SQLERRD array, but haven't >found it. > >I would appreciate any help with this, including other workarounds. > >Regards, >Kelly