Subject Re: [firebird-support] Re: Problem with Firebird used in MS Access via ODBC
Author Helen Borrie
At 06:56 AM 15/10/2003 +0000, you wrote:

> > >What am I doing wrong?
> > >
> > >Any ideas or hints?
> >
> > No. Tell us what the query is.
>
>The query in MS Access is:
>
>SELECT ADDRESS.NAME, STATUS.STATUSNAME, COUNTRY.COUNTRYNAME
>FROM (ADDRESS LEFT JOIN STATUS ON ADDRESS.STATUSID = STATUS.ID) LEFT
>JOIN COUNTRY ON ADDRESS.COUNTRYID = COUNTRY.ID;

Two problems here: (1) bad syntax and (2) ambiguity
Is this the actual query statement that gets sent through the ODBC interface?'

You need to get it to accept correct, standard, unambiguous SQL:

SELECT
ADDRESS.NAME,
STATUS.STATUSNAME,
COUNTRY.COUNTRYNAME
FROM ADDRESS
LEFT JOIN STATUS
ON ADDRESS.STATUSID = status.STATUS.ID
LEFT JOIN COUNTRY
ON ADDRESS.COUNTRYID = country.COUNTRY.ID;

This query is going to return (potentially) a lot of nulls - I'm not sure
whether you regarded that as a problem or not. If you don't want the nulls
then you don't want the outer joins...

heLen