Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: How to show the column total in a multi-record block?

Re: How to show the column total in a multi-record block?

From: Dmitry L. Zhuk <dmitry_at_leaves.spb.su>
Date: 1997/03/24
Message-ID: <33364634.6928@leaves.spb.su>#1/1

Q1: Total for column
1.Create non-database column in control block. 2.Create function that select sum() with dynamic WHERE.  (by DBMS_SQL or Record Group).
3.In Post-Select trigger call you function with :SystemLast_Query. Result store in column.
4.Create Key-DupRec, When-Validate-Item, Key-DelRec to recalculate you total item.

Q2: Update all values in column.
1. Create trigger When-New-Item-Instance on Block level. This trigger allow you navigation.
2. Analyse OLD and NEW values for FACTOR. If they different, then execute procedure that recalculate column_b. procedure calc is
cur varchar2(30);
begin
cur := :System.Current_Record;
First_Record;
<<lop>>
:Block.Column_b:=:Block.Column_A*:Bl.factor; if not :System.Last_Record
then
 Next_Record;
 Goto lop;
else exit;
end if;
Go_Record(cur);
end; Received on Mon Mar 24 1997 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US