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

Home -> Community -> Mailing Lists -> Oracle-L -> Cursor help needed

Cursor help needed

From: Tanya George <tanyag_at_ERC.MSSTATE.EDU>
Date: Thu, 16 Mar 1995 14:28:14 -0600
Message-Id: <9503162336.AA10203@alice.jcc.com>

    I have written the following code to sum items that are from a specific   purchase order number. This code does work, except for the very first time   it executes each time the form is run. I do not know much about cursors   so I am hoping someone out there could point out what I have done wrong...

  I am using forms 4.0.12, oracle 7.0.16 on a Sun Unix system...

  thanks,

  tanya george
  tanyag_at_erc.msstate.edu

declare

    CURSOR po_values(po# in inv_part.purchase_order_no%TYPE) is

                SELECT cost
                from inv_part
                where purchase_order_no = po#;
    temp        inv_part.cost%TYPE;

begin

    :po.dummy_total := 0.0;

    FOR rec in po_values(:acquisitions.purchase_order_no) LOOP

       :po.dummy_total := :po.dummy_total + nvl(rec.cost,0);

    END LOOP; end; Received on Thu Mar 16 1995 - 18:36:24 CST

Original text of this message

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