Subject | Re: [firebird-support] join and columns with the same name on diferent tables |
---|---|
Author | Daniel Rail |
Post date | 2004-04-06T20:24:04Z |
Hi,
At April 6, 2004, 16:51, Alexandre Benson Smith wrote:
years ago.
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)
At April 6, 2004, 16:51, Alexandre Benson Smith wrote:
> What I could not understand is, why the client tools (whatever they are)I don't think that it is.
> don't report the error.... Since it's a server side error...
> Thank you for the explanation that it's only reported on Dialect 3... IThis was part of a discussion when FB 1.0 was still in beta, about 3
> don't remenber to read it...
years ago.
> I thought ambiguous fields check will broke any old applications. And I wasAlthough dialect 3 does the check, it is a very good practice to
> wondering why don't break my bogus query... :)
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)