Skip to Content.
Sympa Menu

freetds - Re: [freetds] odbc problem obtaining column name

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James K. Lowden" <jklowden AT schemamania.org>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] odbc problem obtaining column name
  • Date: Mon, 19 Apr 2004 10:26:02 -0400

On Mon, 19 Apr 2004, Roger Reynolds <rogerr AT softix.com> wrote:
>
> 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...
...
> If I modify the query to
> "select user as user"
>
> then I get the column name defined as I expect.

I'd need to know precisely what your "psuedo column" is to give you a
precise answer, because "select user" isn't parseable T-SQL.

Tables and views have columns with names. Queries and stored procedures
can derive columns that have no names, as with functions.

If you say:

select @@servername
select user_name()
select count(*) from systypes
select 'horseradish'

in each case you'll get a column without a name.

Whether or not a column has a name, you can create your own by tacking on
"as myname" after the element.

HTH.

--jkl




Archive powered by MHonArc 2.6.24.

Top of Page