Subject Re: [IBO] IBO Team please respond. KeyLinks bug.
Author Matt Nielsen
Just finished testing this and it worked perfectly. Thanks again for
the solution.

Matt
--- In IBObjects@yahoogroups.com, "Matt Nielsen" <mnielsen@c...>
wrote:
> Thank you for your response. I will give that a try. Wish there
> were a simpler solution. Not that a view is difficult I would just
> prefer not to use one in this case.
>
> --- In IBObjects@yahoogroups.com, "IB Objects" <jwharton@i...>
wrote:
> > > Can someone from the IBO team please respond to my problem with
> > > KeyLinks and table aliases. This is really causing me problems
> and I
> > > cannot find any work arounds.
> >
> > I'm sorry for being a bit quiet today, I've had a really whopper
of
> a
> > headache today for some reason and I gave in and laid down and
> snoozed for a
> > while.
> >
> > Jason Wharton
> > www.ibobjects.com
> >
> >
> > ----- Original Message -----
> > From: "Matt Nielsen" <mnielsen@c...>
> > To: <IBObjects@yahoogroups.com>
> > Sent: Tuesday, June 10, 2003 7:59 AM
> > Subject: [IBO] IBO Team please respond. KeyLinks bug.
> >
> >
> > >
> > > Here is the situation again.
> > >
> > > I have a query:
> > >
> > > SELECT T1.ID, T2.ID FROM
> > > TABLE1 T1
> > > LEFT OUTER JOIN TABLE1 T2
> > > ON (T1.ID = T2.PARENTID)
> > >
> > > The key links property should allow me to enter T1.ID but it
does
> not
> > > and only allows TABLE1.ID which when the QuickFetch executes it
> > > generates:
> > >
> > > SELECT T1.ID, T2.ID FROM
> > > TABLE1 T1
> > > LEFT OUTER JOIN TABLE1 T2
> > > ON (T1.ID = T2.PARENTID)
> > > WHERE TABLE1.ID = ?BIND_0
> > >
> > > which of course does not retrieve any records. QuickFetch gets
> > > executed when you do a InvalidateBookmark to retrieve/refresh a
> > > single record.
> >
> > Yes, I don't recognize table alias in KeyLinks or any other
> properties. This
> > is because Firebird/InterBase doesn't recognize them in the
values
> returned
> > in the SQLVAR field descriptors at the API level.
> >
> > > Please respond with a work around or an indication that this
will
> be
> > > fixed soon. I've already tried RDB$DB_KEY and other type work
> > > arounds and becuase the QuickFetch is an internal function it
> doesn't
> > > call out the any events where I could fix the SQL before the
> prepare
> > > of the statement. I know I could add my own event to your code
in
> > > the IBA_BindingCursor.IMP unit in the GetPrepare, but I really
> don't
> > > want to hack into your code and would prefer a fix.
> >
> > Using a view is going to be your solution at this point.
> >
> > I realize this may seem messy for you but if you have self-
> referential
> > queries it can actually help keep your head from going in too
many
> circles
> > too.
> >
> > > Thanks,
> > >
> > > Matt