I'm getting this annoying error from a simple query that outputs 40+ columns.
The col that 'must be qualified' is clearly qualified with the col's local
alias every time it appears in the query. There are no macros or other slick
stuff that might be masking this. One other cursor (which does not have a
local alias) contains an identically named column, but this col does not
appear anywhere in the query and is not part of any join condition.
Suggestions?

Re: col name is not unique & must be qualified by Olaf

Olaf
Fri May 02 18:27:11 CDT 2008

> One other cursor (which does not have a
> local alias) contains an identically named column, but this col does not
> appear anywhere in the query and is not part of any join condition.
> Suggestions?

How can a cursor not have an alias?
Try SELECT 0 before doing the SQL

A full qualified name means tablename.fieldname,
not only fieldname.

I can't say what fieldname is not fully qualified without
seeing the SQL-Selcect.

Bye, Olaf.


Re: col name is not unique & must be qualified by Anders

Anders
Fri May 02 18:28:46 CDT 2008

Can you post the query?

-Anders

"Lew" <Lew@discussions.microsoft.com> wrote in message
news:A446089D-156F-4DDD-AF98-85A926CC9E20@microsoft.com...
> I'm getting this annoying error from a simple query that outputs 40+
> columns.
> The col that 'must be qualified' is clearly qualified with the col's local
> alias every time it appears in the query. There are no macros or other
> slick
> stuff that might be masking this. One other cursor (which does not have a
> local alias) contains an identically named column, but this col does not
> appear anywhere in the query and is not part of any join condition.
> Suggestions?



Re: col name is not unique & must be qualified by Lew

Lew
Sat May 03 08:29:58 CDT 2008

> How can a cursor not have an alias?
> Try SELECT 0 before doing the SQL

... local alias as in
from mytable a, anothertable b && 'a' & 'b' are local aliases

the column in question *always* appears as

a.columninquestion && 'a' being the local alias & thus it is fully
qualified.

> I can't say what fieldname is not fully qualified without
> seeing the SQL-Selcect.

The error message tells me the fieldname, so I already know what it is. This
isn't my question.

"Olaf Doschke" <olaf.doschke@t-aufderlinie.de> wrote in message
news:FB84FE42-2EC7-4AF5-81BD-DAA50BD6736D@microsoft.com...
>> One other cursor (which does not have a local alias) contains an
>> identically named column, but this col does not appear anywhere in the
>> query and is not part of any join condition.
>> Suggestions?
>
> How can a cursor not have an alias?
> Try SELECT 0 before doing the SQL
>
> A full qualified name means tablename.fieldname,
> not only fieldname.
>
> I can't say what fieldname is not fully qualified without
> seeing the SQL-Selcect.
>
> Bye, Olaf.
>



Re: col name is not unique & must be qualified by Lew

Lew
Sat May 03 08:38:03 CDT 2008

.... oops! Found it. I was too slick for my own good. The col name in
question is included in a #DEFINE that I must use & haven't looked at
closely for years.
Sorry & thanks all.

"Anders Altberg" <anders.altberg> wrote in message
news:e2v4H1KrIHA.4492@TK2MSFTNGP02.phx.gbl...
> Can you post the query?
>
> -Anders
>
> "Lew" <Lew@discussions.microsoft.com> wrote in message
> news:A446089D-156F-4DDD-AF98-85A926CC9E20@microsoft.com...
>> I'm getting this annoying error from a simple query that outputs 40+
>> columns.
>> The col that 'must be qualified' is clearly qualified with the col's
>> local
>> alias every time it appears in the query. There are no macros or other
>> slick
>> stuff that might be masking this. One other cursor (which does not have a
>> local alias) contains an identically named column, but this col does not
>> appear anywhere in the query and is not part of any join condition.
>> Suggestions?
>
>



Re: col name is not unique & must be qualified by Rush

Rush
Sat May 03 10:55:10 CDT 2008

Lew wrote:
>> How can a cursor not have an alias?
>> Try SELECT 0 before doing the SQL
>>
>
> ... local alias as in
> from mytable a, anothertable b && 'a' & 'b' are local aliases
>
> the column in question *always* appears as
>
> a.columninquestion && 'a' being the local alias & thus it is fully
> qualified.
>

Using 'a' as an alias can be ambiguous, as it can refer to the table in
work area 1.

- Rush

Re: col name is not unique & must be qualified by Anders

Anders
Sat May 03 15:16:38 CDT 2008


"Rush Strong" <rpstrong@gmail.com> wrote in message
news:yV%Sj.869$ch1.479@trndny09...
> Lew wrote:
>>> How can a cursor not have an alias?
>>> Try SELECT 0 before doing the SQL
>>>
>>
>> ... local alias as in
>> from mytable a, anothertable b && 'a' & 'b' are local aliases
>>
>> the column in question *always* appears as
>>
>> a.columninquestion && 'a' being the local alias & thus it is fully
>> qualified.
>>
>
> Using 'a' as an alias can be ambiguous, as it can refer to the table in
> work area 1.
>
> - Rush

If the column can't be found in Mytable A, say because of a missing letter,
then and only then, will VFP try workarea A.
Letters can be missing because the table has been FRREd from a database and
the column names have been truncated to 10 letters.
-Anders



Re: col name is not unique & must be qualified by Rush

Rush
Sun May 04 10:26:57 CDT 2008

Anders Altberg wrote:
> "Rush Strong" <rpstrong@gmail.com> wrote in message
> news:yV%Sj.869$ch1.479@trndny09...
>
>> Lew wrote:
>>
>>>> How can a cursor not have an alias?
>>>> Try SELECT 0 before doing the SQL
>>>>
>>>>
>>> ... local alias as in
>>> from mytable a, anothertable b && 'a' & 'b' are local aliases
>>>
>>> the column in question *always* appears as
>>>
>>> a.columninquestion && 'a' being the local alias & thus it is fully
>>> qualified.
>>>
>>>
>> Using 'a' as an alias can be ambiguous, as it can refer to the table in
>> work area 1.
>>
>> - Rush
>>
>
> If the column can't be found in Mytable A, say because of a missing letter,
> then and only then, will VFP try workarea A.
> Letters can be missing because the table has been FRREd from a database and
> the column names have been truncated to 10 letters.
> -Ander

Or if you simply forget to add the alias - that is;

SELECT 1
USE AnotherTable

SELECT 2
USE MyTable

SELECT A.Field1, B.Field2 FROM MyTable, AnotherTable B

If Field1 exists in AnotherTable, it will be used instead of MyTable.Field1.

- Rush

Re: col name is not unique & must be qualified by Anders

Anders
Sun May 04 16:33:00 CDT 2008

It's happened to me : }

-Anders

"Rush Strong" <rpstrong@gmail.com> wrote in message
news:5BkTj.626$JF1.610@trndny06...
> Anders Altberg wrote:
>> "Rush Strong" <rpstrong@gmail.com> wrote in message
>> news:yV%Sj.869$ch1.479@trndny09...
>>
>>> Lew wrote:
>>>
>>>>> How can a cursor not have an alias?
>>>>> Try SELECT 0 before doing the SQL
>>>>>
>>>>>
>>>> ... local alias as in
>>>> from mytable a, anothertable b && 'a' & 'b' are local aliases
>>>>
>>>> the column in question *always* appears as
>>>>
>>>> a.columninquestion && 'a' being the local alias & thus it is fully
>>>> qualified.
>>>>
>>>>
>>> Using 'a' as an alias can be ambiguous, as it can refer to the table in
>>> work area 1.
>>>
>>> - Rush
>>>
>>
>> If the column can't be found in Mytable A, say because of a missing
>> letter, then and only then, will VFP try workarea A.
>> Letters can be missing because the table has been FRREd from a database
>> and the column names have been truncated to 10 letters.
>> -Ander
>
> Or if you simply forget to add the alias - that is;
>
> SELECT 1
> USE AnotherTable
>
> SELECT 2
> USE MyTable
>
> SELECT A.Field1, B.Field2 FROM MyTable, AnotherTable B
>
> If Field1 exists in AnotherTable, it will be used instead of
> MyTable.Field1.
>
> - Rush