Skip to Content.
Sympa Menu

freetds - Re: ODBC and column names

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Brian Bruns <camber AT ais.org>
  • To: TDS Development Group <freetds AT franklin.metalab.unc.edu>
  • Subject: Re: ODBC and column names
  • Date: Tue, 27 Aug 2002 16:52:24 -0400 (EDT)


On 27 Aug 2002, Paul Rensing wrote:

> I was having trouble with column names in ODBC and ran across the code
> in SQLDescribeCol(). In there, it uppercases the column names and
> truncates them to the size of the provided space.
>
> So, 2 questions.
>
> 1) Does ODBC require uppercasing of column labels?

I don't know about this one, but since Sybase is case sensitive it seems a
bug. For databases that are case insensitive (ie DB2), it would probably
be ok.

> 2) If it truncates the name, there seems to be a bug in that, in the
> variable pcbColName, it returns the real length of the string, not the
> truncated length. What is it supposed to return?

Description:

Bytes available to return for ColumnName argument. Truncation of column
name (ColumnName) to BufferLength - 1 bytes occurs if NameLengthPtr is
greater than or equal to BufferLength.

My reading of this is that the number of bytes available is returned, and
pcbColName is truncated if necessary, allowing the program to increase
it's buffer size and reinvoke the function if necessary. So, the code
seems to be correct on this point.

>
> Thanks.
>
> Paul Rensing
>





Archive powered by MHonArc 2.6.24.

Top of Page