Home » SQL & PL/SQL » SQL & PL/SQL » can I create cursors as arrey?
can I create cursors as arrey? [message #36312] Thu, 15 November 2001 13:31 Go to next message
Daniel Tsai
Messages: 8
Registered: November 2001
Junior Member
Dear,
I am trying to declare cursors as arrey because I am not sure how many cursors I have to create and all of them are almost the same. can a procedure call itself in it's body? The following is the code, please give me some suggestions. Thanks a lot.

Daniel
------------------------------------
declare
type part_rec is table of varchar2(100) index by binary_integer;
f_part part_rec;
v_2ndpart bomms.2nd_partno%type;
i integer :=1;
n integer :=1;
-----------------------------------------------------
procedure compare_bom(v_2ndpart)
is
cursor cr_bomms is
select * from bomms
where 1st_partno = v_2ndpart;
cur(n) cr_bomms%rowtype;

begin
for cur(n) in cr_bomms loop
if cur(n).sub_partfg = 'N' then
f_part(i) = cur(n).2nd_partno;
i := i + 1;
else
v_2ndpart := cur(n).2nd_partno;
n := n + 1;
compare_bom(v_2ndpart);
end if
end loop;
end;

----------------------------------------------------------------------
Re: can I create cursors as arrey? [message #36328 is a reply to message #36312] Fri, 16 November 2001 08:36 Go to previous message
andrew again
Messages: 2577
Registered: March 2000
Senior Member
Have you taken a llok at the "connect by statement". It looks like you are querying a hierarchy.
Also too this link:
http://asktom.oracle.com/pls/ask/f?p=4950:8:92270::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:1286876577713,

----------------------------------------------------------------------
Previous Topic: possibility to list files in a directory ?
Next Topic: size of long column?
Goto Forum:
  


Current Time: Fri Apr 19 19:00:13 CDT 2024