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 -> Help with Cursors

Help with Cursors

From: Arthur Merar <amerar_at_unsu.com>
Date: Sun, 28 Feb 1999 22:51:17 GMT
Message-ID: <36d9c82c.79193336@news.chaven.com>

Hello,

I am pretty new to Oracle and PL/SQL. I need to change some code but do not understand what it is doing. Below is a clip of the code:

.
.
.
.

Cursor c1 is

   Select itemnum, clisedate, ponum, vendorid, acctcode, costcenter from purreq;

Cursor c2(p_itemnum purreq.itemnum%type,

                p_closedate purreq.closedate%type,
                p_ponum purreq.ponum%type,
                p_vendorid purreq.vendorid%type) is
   select acctcode, costcenter from tmp_purreq    where ponum = p_ponum
   and itemnum = p_itemnum
   and closedate = p_closedate
   vendorid = p_vendorid;

BEGIN
   open c1;
   loop

      fetch c1 into var_itemnum, var_closedate, var_ponum,
                          var_vendorid, var_acctcode, var_costcenter;
   exit when c1%NOTFOUND;

   open c2(var_itemnum, var_closedate, var_ponum, var_vendorid);    loop
   fetch c2 into v_acctcode, v_costcenter;    exit when c2%NOTFOUND;
.
.
.
.

I do not understand what the parameters are for when the c2 cursor is defined. What is all the references to the purreq table for?

Also, I do not understand the parameters when the c2 cursor is opened. Why all the var_ variables??

Can someone please explain these things to me. I would appreciate it a lot.

Thanks,

Please respond via e-mail.

Arthur
amerar_at_unsu.com Received on Sun Feb 28 1999 - 16:51:17 CST

Original text of this message

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