How to get table alias



I do a select to a table like:

SELECT
*
FROM
some_table, user as creator, user as alt_user
WHERE
some_table.cre_user=creator.usr_id AND
some_table.alt_user=alt_user.usr_id

Then a execute the select using SQLExecDirect,
Then I read the results.

The question is that I would like to get the user name for the creator and
for the alternate user from the same table.
I call the SQLColAttribute(SQL_COLUMN_QUALIFIER_NAME) but I get allways the
name of the table and I cant distinguish if the USR_NAME is for the creator
(1st join) or the alternate user (2 join).

How could I get the alias for a column using ODBC?


Many, many thanks...


.



Relevant Pages

  • Table alias name
    ... some_table, user as creator, user as alt_user ... Then a execute the select using SQLExecDirect, ... for the alternate user from the same table. ...
    (microsoft.public.data.odbc)
  • Re: Table alias name
    ... some_table, user as creator, user as alt_user ... Then a execute the select using SQLExecDirect, ... for the alternate user from the same table. ... Try specifying only the columns you want retrieved and giving each an alias. ...
    (microsoft.public.data.odbc)
  • Re: SYSSTART Not Being Executed
    ... was the stumbling block...Cheers, Dan ... The creator has to be manager.sys. ... I can execute it manually after with no problem. ... To join/leave the list, search archives, change list settings, * ...
    (comp.sys.hp.mpe)
  • Re: SYSSTART Not Being Executed
    ... Who is the creator of SYSSTART? ... I would suspect the creator if this worked before on another machine. ... I can execute it manually after with no problem. ... To join/leave the list, search archives, change list settings, * ...
    (comp.sys.hp.mpe)

Loading