home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a524 / 37.ddi / demo / examp5.sql < prev    next >
Encoding:
Text File  |  1991-03-04  |  716 b   |  27 lines

  1. rem 
  2. rem $Header: examp5.sql,v 1002100.2 90/01/11 16:56:00 nsalah Exp $ examp5.sql Copyr (c) 1989 Oracle
  3. rem 
  4. rem V6PLS10021,DISK$DEV9:[PLS.DEMO.10021]
  5. /*
  6. ** This block does some numeric processing on data that is
  7. ** stored in data_table that comes from experiment #1.  The
  8. ** results are stored in the TEMP table.
  9. **
  10. ** Copyright (c) 1989 Oracle Corporation
  11. */
  12.  
  13. DECLARE
  14.     result   temp.col1%TYPE;
  15.     CURSOR c1 IS
  16.         SELECT n1, n2, n3 FROM data_table
  17.             WHERE exper_num = 1;
  18. BEGIN
  19.     FOR c1_rec IN c1 LOOP
  20.             /* calculate and store the results */
  21.         result := c1_rec.n2 / (c1_rec.n1 + c1_rec.n3);
  22.         INSERT INTO temp VALUES (result, null, null);
  23.     END LOOP;
  24.     COMMIT;
  25. END;
  26. /
  27.