Subject Re: [IBO] BufferFieldByName & Co.
Author Eyal
--- In IBObjects@yahoogroups.com, Robert martin <rob@c...> wrote:
>
> I may be shooting in the dark as well (I am no FB / IBO expert)
> but a solutions for the first issue....
>
> For your display with a running total, could you do it with a
> Stored procedure that calculated the running total and displayed
> the other rows as is? If it needs to be editable your could run
> SQLs to edit the source and refresh your procedure?

You're not shooting in the dark at all ;-) Indeed I use a Stored
Procedure.

However it is far from a good solution. The SP is VERY complex because
the query involves numerous tables, some of which aren't always
needed, it needs to accept optional WHERE conditions, and optional
ORDER BY.

It is further complicated because there are several LEFT OUTER JOINs
that confuse the optimizer, so depending on the input parameters I
also need to re-design the query a little bit in order to help the
optimizer achieve a reasonable execution plan.

And whenever I change something in any of the tables involved in the
query - I also need to change the SP.

A much better solution is to be able to just issue a query and have a
dataset descendant that maintains a running total column.

Regards,

Eyal.