Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Help with Cursors
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) isselect acctcode, costcenter from tmp_purreq where ponum = p_ponum
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