Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Running totals using POST-QUERY trigger.
In your block -> Property Palette..
Records Query All Records -> Set to YesIn your block
Under Properties Palette Calculation -> Mode Summary Summary Function -> Sum Summarized Block - your block Summarized Item - your item..
Paul Hancock wrote in message <7sb4a4$56s$1_at_neptunium.btinternet.com>...
>I am trying to calculate a running total of a certain item from the records
>of a base table block and then populate the result into a "total" item.
>
>I using a POST-QUERY trigger to do this, but am having a few problems.
>
>1. If I have something like ...
>
>temp_total := temp_total + base_table_value
>
>within the trigger PL/SQL code, I lose the value of temp_total when program
>control leaves the PL/SQL block in the POST-QUERY trigger.
>
>2. If I use a :GLOBAL variable to accumulate the total, I get a message
>saying "GLOBAL variable does not exist" at runtime. I tried setting
>:GLOBAL_temp_total := 0 in the form level trigger, but still get message
>"GLOBAL variable does not exist" when program enters POST_QUERY trigger.
>
>HELP!!!!!
>
>Is a POST-QUERY trigger the right way to do this, or is there another way?
>
>What trigger would I use to clear down the total variable if I wished to
>recalculate the total (ie. is there a trigger that fires just before a
query
>executes but NOT for all rows. just the first one?
>
>All assistance greatly appreciated.
>
>
>
Received on Wed Sep 22 1999 - 17:17:12 CDT
![]() |
![]() |