Subject Re: [firebird-support] join and columns with the same name on diferent tables
Author Daniel Rail
Hi,

At April 6, 2004, 16:51, Alexandre Benson Smith wrote:
> What I could not understand is, why the client tools (whatever they are)
> don't report the error.... Since it's a server side error...

I don't think that it is.

> Thank you for the explanation that it's only reported on Dialect 3... I
> don't remenber to read it...

This was part of a discussion when FB 1.0 was still in beta, about 3
years ago.

> I thought ambiguous fields check will broke any old applications. And I was
> wondering why don't break my bogus query... :)

Although dialect 3 does the check, it is a very good practice to
qualify your fields even in dialect 1. The reason why this check was
put in place was that it was proven that the result can be erroneous
and not consistent.

Taking your first example, the field Number could be taken from either
Table1 or Table2, and this can be random everytime you would prepare
the query. Your example makes it obvious, because in Table1 Number is
an Integer and in Table2 Number is a varchar. But, imagine if the
field Number in both tables were integers, and that you would see
different results with the same Where clause, from time to time, then
you would be wondering what's wrong.

--
Best regards,
Daniel Rail
Senior System Engineer
ACCRA Group Inc. (www.accra.ca)
ACCRA Med Software Inc. (www.filopto.com)