Subject Re: TIB_Query.InvalidateRowNum invalidating a bit too much
Author Jason Wharton
--- In IBObjects@yahoogroups.com, "Daniel Albuschat"
<d.albuschat@...> wrote:
>
> Hello there,
>
> I'm using the function TIB_Query.InvalidateRowNum to update the
> query's buffer if the underlying data has changed.
> The select in the query looks like "select * from function_foo()".
The
> problem is this: When the data has changed in such a way that
> function_foo does not include the old dataset anymore, the dataset
is
> removed from the list. This behavior is, however, very bad in the
my
> situation.
>
> I have currently no good ideas how to prevent this. The only one I
can
> come up with is checking whether the current dataset is returned by
> the function before calling
> InvalidateRowNum and skip it if it does not exist. That way, the
data
> is not refreshed, though - but it's at least better than the whole
> dataset disappearing.
>
> The optimal solution would be a separate select-statement that is
used
> for invalidation, but I guess this is not possible, is it?
>
> Regards,
> Daniel Albuschat
>
> --
> eat(this); // delicious suicide
>

This is an area of IBO that I would like to enhance so that it is
more flexible. Essentially, this would require a new SQL property
that would allow you to configure your own custom row refresh and
thus it would be called RefreshRowSQL and when it is called it would
pass in the input parameters you desire and then whatever columns it
returned would be plugged into the row being refreshed.

This is essential when using a select SQL as a query since their
output is purely sequential. You would need a separate select SQL
using a different stored procedure that has input values for your
key column data that would tell it how to fetch just the single row
of interest.

At this time, I don't know an easy way to do this. It is something
that I would like to accommodate in a future version of IBO.

For now, InvalidateRowNum and the like, should only be expected to
work as designed when you have a dataset that uses valid KeyLinks
against a dataset where the internal RefreshRowSQL (it's not called
that) statement can be automatically determined and made use of.

Jason