Running totals using POST-QUERY trigger.

From: Paul Hancock <freddie_at_hotmail.com>
Date: Wed, 22 Sep 1999 18:29:16 +0100
Message-ID: <7sb4a4$56s$1_at_neptunium.btinternet.com>



[Quoted] 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 [Quoted] executes but NOT for all rows. just the first one?

All assistance greatly appreciated. Received on Wed Sep 22 1999 - 19:29:16 CEST

Original text of this message