Subject Re: [IBO] When is KeyRelation necessary?
Author Nando Dessena
Hi Helen,

> >I am using a TIBOQuery with a somewhat complex SQL statement (a left
> >join and a "where exists" clause). The dataset is not editable unless I
> >set KeyRelation. I thought that it was required when using implicit join
> >syntax only, while I am using explicit syntax.
> You are getting confused with JoinLinks, I think.

That may very well be. Perhaps I should have RTFM, which describe it
all. :-(
To sum up:
- to have an editable dataset with a join you always need to set
KeyRelation, no matter which syntax you use for the join.
- if you use implicit join syntax, you also need to set JoinLinks.
- in every case you need KeyLinks (or KeyLinksAutoDefine where

> >The query is something like that:
> >
> >select a.*,
> >from a left join b on ( =
> >where exists (select from some_stored_procedure(:a_param) s where
> > =
> >order by
> >
> >I have set KeyLinks to '', and thought that would be enough.
> >Setting KeyRelation to 'a' does work well, so it's not really an issue
> >for me, just a curiosity.
> What does it *do* when it "works well"?

I should have been more specific. It makes the dataset updateable, ie it
generates the update instructions all of its own, which is a big win for
me compared to the clumsy TUpdateSQL I used to have on that data module.