在一般的情況下
declare
cursor c
v_depart t_depart%rowtype ;
type v_code_type is table of t_depart
v_code v_code_type ;
type v_name_type is table of t_depart
v_name v_name_type ;
begin
open c
fetch c
for i in unt loop
dbms_output
end loop;
close c
end;
通過上面的這個例子
declare
cursor c
type v_depart_type is table of t_depart%rowtype ;
v_depart v_depart_type ;
begin
open c
fetch c
for i in unt loop
dbms_output
v_depart(i)
end loop;
close c
end;
在輸出結果時
declare
cursor c
type v_depart_type is table of t_depart%rowtype ;
v_depart v_depart_type ;
begin
open c
fetch c
for i in v_depart
dbms_output
v_depart(i)
end loop;
close c
end;
From:http://tw.wingwit.com/Article/program/Oracle/201311/18238.html