Subject | Re: advice on mantaining a current account |
---|---|
Author | Emil Totev |
Post date | 2008-10-10T06:45:51Z |
In a similar situation I am using a selectable stored procedure, which
calculates the current balance in an output variable.
Emil
--- In firebird-support@yahoogroups.com, "Sergio H. Gonzalez"
<shg_sistemas@...> wrote:
calculates the current balance in an output variable.
Emil
--- In firebird-support@yahoogroups.com, "Sergio H. Gonzalez"
<shg_sistemas@...> wrote:
>Firebird
> Hi, I think this is a very old question, but I never did it with
> before.movements
>
> I want to do a simpe current acount with in-out-balance columns. The
> would come from the invoices and payments tables ordered by date. Iusually did
> it with triggers that insert the movements in a separate table andre-calculate
> all the balances (with a stored procedure) for each record everytime something
> in inserted, modified or deleted. I wonder if there is a way to doit "on the
> fly".. I mean when the user want to see some current account, justdo " select
> (some fields) from invoices union all select (some fields) frompayments order
> by 1" (being "1" the pos of the date field). Firts of all, I don'tknow how fast
> would be this approach as the DB gets bigger, and second: I dontknow how to
> resolve the "balance" column on a select, because it depends on theprevious
> row. May I have some diferent opinions of experienced people?Thanks!! -s
>