Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Running totals using POST-QUERY trigger.
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.
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 - 12:29:16 CDT
![]() |
![]() |