Re: Issue with legacy informix driver
Posted in 1998
mbristol@my-dejanews.com offerred: +When the application calls EXEC SQL DESCRIBE stmt INTO sqldba_p; I'm seeing +the resultant structure alter the column datatypes (sqlba_p=>sqltype) to +something other than that which I'd expect. I'm seeing columns created in +the database (and viewable in informix.syscolumns.coltype ...) as REAL, +FLOAT, and DECIMAL all returned to me with a DECIMAL type attached to them. It would help to see the actual query you are applying the describe to, but I'll guess that you are doing some math or aggregate calculation on the REAL and FLOAT columns in the query? Informix likes to do math operations in decimal type, and will convert other numeric types to decimal when appropriate. So, for example, if you were to do a SUM(colX) where colX is of type REAL in the database, the resulting column type from the query will be decimal (I believe they do this to avoid overflows - a decimal supports up to 32 significant digits). There are functions available that will convert a decimal into a REAL or FLOAT, or you can alter the sqlda structure returned from the DESCRIBE and change the sqltype to CFLOATTYPE, for example. This will cause the engine to convert the data into the type of your host variable structure. Be aware that if the conversion is may not be possible - I believe you will get an error code back if that is the case (e.g. the value may be too big for a FLOAT). Dave Dave Kosenko davek@summitdata.com Director of Training Services (732) 469-4070 Summit Data Group (an Informix Authorized Education Center)