Subject Re: [IBO] Re: keylinks keysource and select sp
Author Helen Borrie
At 12:53 PM 15/03/2006, you wrote:
>--- In IBObjects@yahoogroups.com, "jeffplata" <jeffplata@...> wrote:
> >
> > (Using IBO 4.5B)
> >
> > Is it possible to define a lookup relationship using
>keylinks/keysource
> > between two ib_queries where one gets data from a stored procedure?
> > Something in this manner:
> >
> > mainquery:
> > sql='select gl, sl, dramount, cramount from rp_tbsl(:period)';
> >
> > lookupquery:
> > sql='select gl, description from accounts';
> > keylinks='accounts.gl=?????? // what goes here?
> > keysource=ib_datasource1
> >
> > ib_datasource1:
> > dataset=mainquery;
> >
>
>If this kind of lookup relationship is not possible, what is the IBO
>way of achieving this effect?

It's more a question of whether it makes any logical sense.

The purpose of the keylinks relationship is to provide update values
for the linked key in the keysource. But here ---

1) your main set is not an updatable dataset, it is a virtual
dataset (doesn't exist in the database)
2) the linked value is the closest thing you have got to a keylink
in the main set. What are you trying to do? - use the lookup value
to change the gl value in a table somewhere? Do you have
parameterised EditSQL, InsertSQL and DeleteSQL statements in main
dataset to achieve this? And, if you have, do you understand how
this will affect the validity of your virtual output?

So it would assist greatly if you would just explain exactly what
you're trying to achieve here.

Helen