Re: How would I write...? HELP!

From: Srinivasa Kunamneni <eleeb02_at_menudo.uh.edu>
Date: 1996/06/19
Message-ID: <4qa3at$lsa_at_masala.cc.uh.edu>#1/1


Mike Oswald (moswald_at_unmc.edu) wrote:
: I am working with a Cytogenetics group doing chromosome studies/research
: and they have a need for controls (control data). One of their tables
: might look like...
 

: signal_1 signal_2 signal_3 signal_4 signal_1_pct signal_2_pct ..etc..
: -------- -------- -------- -------- ------------ ------------
: 12 78 10 0 12% 78%
: 5 75 18 2 8.5% 76.5%
: 6 84 10 0 7.76% 79%
 

: I need to SUM each signal and divide by the total cell count for each record
: to get the percentage for each signal.
 

: I know that I can/might be able to do this within the SQL*Forms at the time
: each record is commited to the database (the researcher decides which of the
: data records will be added to the control set).
 

: Anyone have a clue as to how I might process this information? Using the
: SUM feature groups data and I want to process one record at a time but be
: able get the TOTAL cell count and the TOTAL SIGNAL_n count too.
 

: That's in advance for your help...
 

: -Mike

If you want to do this in Forms:
Code the following procedure in PRE-INSERT, PRE-UPDATE of the block containing those fields.

Procedure Compute_percents is
 total_cell_count Number;
Begin
  total_cell_count := :block.signal_1 + :block.signal_2 ......;   :block.signal_1_pct := :block.signal_1/total_cell_count *100;

  .
  .
  .

End;

Note:
If signal has null value, your have to use nvl (otherwise cell count will be null).

Srini Kunamneni Received on Wed Jun 19 1996 - 00:00:00 CEST

Original text of this message