Subject | Re: sql problem |
---|---|
Author | Svein Erling |
Post date | 2003-11-05T12:26:41Z |
--- In firebird-support@yahoogroups.com, Helen Borrie <helebor@t...>
wrote:
Admittedly, I forgot that there were people whom upgrade to Firebird
1.5 even though they still use dialect 1 (quite contrary to us who
upgraded to dialect 3 immediately, but still are on 1.0.2). Though for
1.0.2, this problem exists for dialect 3 as well, i.e.
SELECT A.FieldInTableA, TableB.FieldInTableB, A.FieldInBothTables
from TableA A
join TableB on TableA.PK = TableB.PK
join TableB B on TableA.PK = TableB.FK
prepares just fine. Even
SELECT FieldInTableA, FieldInTableB, A.FieldInBothTables
from TableA A
join TableB on TableA.PK = TableB.PK
join TableB B on TableA.PK = TableB.FK
prepares OK. The only way to force the ambiguous field error, is to
remove the table qualifier for FieldInBothTables.
So, the question is then whether this has been fixed after 1.0.2. This
thread suggest that this may not be the case (the original question
never mentioned dialect 1). Anyone able to answer?
Set
wrote:
> SveinHi Helen!
> At 11:21 AM 5/11/2003 +0000, you wrote:
> >I think your sql is ambiguous and am surprised that Firebird
> >doesn't reject it due to syntax.
>
> I agree with your diagnosis but, AFAIK, the ambiguous syntax will
> only be rejected on a dialect 3 database. You can still write bad
> queries in dialect 1.
> :-))
> h.
Admittedly, I forgot that there were people whom upgrade to Firebird
1.5 even though they still use dialect 1 (quite contrary to us who
upgraded to dialect 3 immediately, but still are on 1.0.2). Though for
1.0.2, this problem exists for dialect 3 as well, i.e.
SELECT A.FieldInTableA, TableB.FieldInTableB, A.FieldInBothTables
from TableA A
join TableB on TableA.PK = TableB.PK
join TableB B on TableA.PK = TableB.FK
prepares just fine. Even
SELECT FieldInTableA, FieldInTableB, A.FieldInBothTables
from TableA A
join TableB on TableA.PK = TableB.PK
join TableB B on TableA.PK = TableB.FK
prepares OK. The only way to force the ambiguous field error, is to
remove the table qualifier for FieldInBothTables.
So, the question is then whether this has been fixed after 1.0.2. This
thread suggest that this may not be the case (the original question
never mentioned dialect 1). Anyone able to answer?
Set