[unixODBC-support] SQLDescibeCol returns uninitialized values

Nick Gorham nick.gorham at easysoft.com
Thu Dec 17 10:01:24 GMT 2009


Sprenker Ludger wrote:
>
> Hi,
>
> I’m using unixODBC with Informix odbc client and have a problem with 
> SQLDescribeCol when there are columns with no name (like the result of 
> “SELECT UPPER(column) …” or “SELECT COUNT(*) ..”).
>
> Neither unixODBC nor the Informix odbc client are writing to the 
> output parameters ColumnName and NameLengthPtr in this case. So the 
> value of *NameLengthPtr is undefined which caused sometimes stupid or 
> invalid calls of malloc() in our application.
>
> MSDN says that ColumnName is a null terminated empty string if the 
> value can not be determined or the column has no name. So I think 
> unixODBC should init this fields before calling the odbc client driver:
>
> ColumnName[0] = ‘\0’;
>
> *NameLengthPtr = 0;
>
> Thanks!
>
> Ludger
>
> My system:
>
> Kubuntu 9.10 (x86)
>
> unixODBC 2.2.14
>
> Informix 11.50
>
Hi,

I see what you are saying, but I think in this case its the drivers 
responsibility to do that not the driver manager. Have you asked the 
informix folk about this?

-- 
Nick


More information about the unixODBC-support mailing list