Subject RE: [IBO] V4.7.16 enhancement plea
Author Paul Hope
Hi Jason

Sorry its taken me a while to get back on this

> Paul,
>
> I am in the process of revising the parsing of JOIN clauses
> and I would like to take a look at this issue. Please send
> me a DDL (or FDB) file and a simple sample application
> showing the use cases that IBO fails to handle properly.

Its just a contruction like

Select a.f1,b.f2,c.f3
From((tablea a join tableb b on a.aa=b.bb)join tablec c on c.cc=b.bb)
Where . .

>
> It is true that IBO does not do well with JOIN clauses that
> are entirely contained within brackets and I'm not even sure
> exactly how or why someone would want to do this so I would
> be most comfortable working with your case than trying to
> cook one up myself.

I don't believe there is a reason for using brackets in the way that I and
some other have done - if there was a reason years ago it isnt valid now.
I cant really remember but it may have been in the mistaken belief that I
was setting the order of execution of the joins to some benefit. On the
other hand I could have been following an example that I had seen somewhere
without knowing the ramifications.

The problem is that
they do exist,
they can be very difficult to find
they do not cause an error used directly in Firebird itself
they cause unpredictable results through IBO.

>
> Also, if you would do some research on the use of brackets in
> JOIN clauses I would very much like to gain a better
> understanding. My use of SQL in all my applications has not
> demanded that level of depth so I would like learn more here.
>

So I don't think there is anything to research. The test case would be to
just take an explicit 2 or more table join clause and put the brackets in
;-)

Regards
Paul

> Thanks,
> Jason Wharton
>
> > -----Original Message-----
> > From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com]On
> > Behalf Of Paul Hope
> > Sent: Friday, May 04, 2007 2:54 AM
> > To: IBObjects@yahoogroups.com
> > Subject: [IBO] V4.7.16 enhancement plea
> >
> >
> > ( 'Brackets' english = 'Braces' US) ;-)
> >
> > A while back the problem came to light that the use of '('s in join
> > caused unpredictable results in the latest version.
> > eg ((a join b on blabla) left join c on bladebla)
> >
> > I accepted that the brackets are completely useless and
> shouldn't be
> > there and couldn't recall where I got the idea of using them in the
> > first place.
> >
> > I searched my app for variations of 'from ((' and ')left'
> and ')join'
> > to try and remove them all.
> >
> > Since then one has fallen through the cracks and caused a
> customer to
> > print 40,000 pages of a 10 page report. Also some posts on the
> > FirebirdSQL forum have shown that other people have used
> brackets in
> > joins.
> >
> > My plea therefore is to have IBO throw out an invalid join syntax
> > error rather than carry on with unpredictabe results ;-)
> >
> > Regards
> > Paul
> >
> >
> > [Non-text portions of this message have been removed]
> >
> >
> >
> > ______________________________________________________________
> > _____________
> > IB Objects - direct, complete, custom connectivity to Firebird or
> > InterBase
> > without the need for BDE, ODBC or any other layer.
> > ______________________________________________________________
> > _____________
> > http://www.ibobjects.com - your IBO community resource for
> Tech Info
> > papers, keyword-searchable FAQ, community code
> contributions and more
> > !
> > Yahoo! Groups Links
> >
> >
> >
>
>
>
> ______________________________________________________________
> _____________
> IB Objects - direct, complete, custom connectivity to
> Firebird or InterBase
> without the need for BDE, ODBC or any other layer.
> ______________________________________________________________
> _____________
> http://www.ibobjects.com - your IBO community resource for
> Tech Info papers,
> keyword-searchable FAQ, community code contributions and more
> !
> Yahoo! Groups Links
>
>
>