Re: Curious Join issue causing an E_FAIL error (with odbc version

From: Stijn Vanroye <s(dot)vanroye(at)easytowork(dot)nl>
To: pgsql-odbc(at)postgresql(dot)org
Subject: Re: Curious Join issue causing an E_FAIL error (with odbc version
Date: 2006-11-10 16:55:19
Message-ID: ej2b7r$20dq$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

Tom Lane schreef:
> Stijn Vanroye <s(dot)vanroye(at)easytowork(dot)nl> writes:
>> select
>> <some fields>,
>> C.id
>> from
>> A
>> left join B on (A.fkB_id=B.id)
>> left join C on (b.fkC_id=C.id)
>
>> The above query produces the error.
>> With some trial and error I managed to avoid the error by ommitting the
>> C.id field from the select. Of course this is hardly a solution since I
>> need those values ;)
>
>> The next thing I tried was replace the C.id field with B.fkC_id (which
>> have the same value since they form the join condition). No more error...
>
> Um, well no they don't necessarily have the same value. Since it's a
> left join, C.id might read as null.
You are right, I stand corrected (and ashamed). I think that in my
specific case and use of the data this is not a problem, but I will have
to check into that to make sure!

>
> Perhaps your E_FAIL was a consequence of some bit of your code not being
> prepared to cope with a NULL value?
I don't think that's the case. My code never came into play. I am using
ADO components in delphi, maybe there is a problem with coping with null
values. But, the code for these components is completely unchanged
troughout all my tests (actually I think it hasn't changed since the
dawn of man ;) ). In fact, all my software, as well as the data and
where conditions have been exactly the same with every test case. With
no changes to the query, code, data or where conditions the error
manifested itself with the driver version 8.2.x, while it didn't occured
when using the 8.1.x driver.

Regards,

Stijn Vanroye

www.xillion.nl
www.easytowork.nl

In response to

Responses

Browse pgsql-odbc by date

  From Date Subject
Next Message Tom Lane 2006-11-10 18:55:46 Re: Curious Join issue causing an E_FAIL error (with odbc version
Previous Message Tom Lane 2006-11-10 16:21:55 Re: Curious Join issue causing an E_FAIL error (with odbc version 8.2.2.0)