Subject | Clear Resultset of a Stored Procedure |
---|---|
Author | Matze |
Post date | 2007-03-06T12:17:19Z |
Hi Firebird-Folks ;-)
I hava a Problem: I have to create a sort of a account in my Database.
The table looks like this:
ID User_id Text Amount
1 1 test 5
2 1 test2 3
3 1 test3 -8
4 1 test 10
I want to create a stored Procedure, which creates an output of this
account since the last amount sum of 0.
To explain that:
The result of this example shoult be 10, because the result should begin
after the last line of 0 and 5+3+8=0.
How can I do this?
My Idea was, to sum up the amount in a loop and if the sum reaches 0
clear the output dataset, but I dont know how.
Thanks for you help
Matthias Feist
I hava a Problem: I have to create a sort of a account in my Database.
The table looks like this:
ID User_id Text Amount
1 1 test 5
2 1 test2 3
3 1 test3 -8
4 1 test 10
I want to create a stored Procedure, which creates an output of this
account since the last amount sum of 0.
To explain that:
The result of this example shoult be 10, because the result should begin
after the last line of 0 and 5+3+8=0.
How can I do this?
My Idea was, to sum up the amount in a loop and if the sum reaches 0
clear the output dataset, but I dont know how.
Thanks for you help
Matthias Feist