[freetds] odbc problem obtaining column name

ZIGLIO, Frediano, VF-IT Frediano.Ziglio at vodafone.com
Mon Apr 19 07:07:44 EDT 2004


> 
> >From an ODBC application, given a query like this
>    "select user"
> where the column selected is not a real column, but
> a "psuedo column" or whatever the right term is...
> 
> I'm trying to use SQLColAttribute to obtain the "column name"
> which I believe should be "USER".
> 

No, user it's like a function, you haven't a column name.

> I've tried the SQL_COLUMN_NAME, as in
> 	SQLColAttribute ( stmtHandle, 1, SQL_COLUMN_NAME,
> 			 colname, sizeof(colname),
> 			 NULL, NULL);
> 
> which succeeds, but returns an empty string in colname.
> 
> If I modify the query to 
>    "select user as user"
> 
> then I get the column name defined as I expect.
> 
> 
> Bug or Feature?
> 
> Thanks
> 

Feature :)

freddy77



More information about the FreeTDS mailing list