Subject Re: [IBO] KeyLinks and KeyLinksAutoDefine
Author TeamIBO
> I added the RequestLive property - that does make sense, right?

I am not sure. The existing procedure already implements the
checks...

if PreparingSQL and
KeyLinksAutoDefine and
not KeyLinksExist and
not Assigned( FBindingCursor ) and
not SQLIsAggregate and
not SQLIsSelectProc and
not ( SQLUnion.Count > 0 ) then
begin

Notice that there is no check for RequestLive. That is to say, you
can request automatic keylinks even when you dont require a live
dataset. (KeyLinks do have other uses - such as bookmarks).

I probably should note that IBO already checks for an '*' and if it
exists then IBO assumes it is an * on the keyrelation and therefore
assumes that the key fields will exist in the query.

And there is that word "assumes" again :-) It is possible for a joined
query to be setup with explicit fields from the keyrelation and an *
from the other relation(s). However in the instance of a joined query
you would have to have stated which was the keyrelation to have
autodefine try to work at all. Given this extra requirement, the
unlikely situation in which th problem would occur, and the fact that
autodefine on joined datasets is hazardous anyway it seems to me that
the existing check for '*' is probably OK.


I will probably wait for Jason to return before I take this any
further. I want to know what his response will be to implementing an
interim prepare to confirm valid keylinks fields. It could have
considerable impact on applications that rely on KeyLinksAutoDefine
and try to prepare a number of queries all at once (such as at
application startup).

It may be that he will prefer the simple "full word check" to best
guess the existance of the key fields. And then let people with more
complex situations handle it more specifically.

If that is the path he prefers you may need to implement your own
keylinks automation according to your own preferences - bear in mind
that the situation of user interactive queries performed via WorkBench
and other utility tools is considerably different to that of most
applications, and so special handling of this situation should not be
unexpected.


--
Geoff Worboys - TeamIBO
Telesis Computing