Re: Running totals using POST-QUERY trigger.

From: Paul Q <paulq_at_home.com>
Date: Wed, 22 Sep 1999 22:17:12 GMT
Message-ID: <IzcG3.5368$zl1.67028_at_news2.rdc1.on.home.com>


In your block -> Property Palette..

                   Records
                       Query All Records -> Set to Yes
In your block
Create a display item,data type number
            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 Thu Sep 23 1999 - 00:17:12 CEST

Original text of this message