type charArray is table of varchar2(200) index by binary integer;
theCursor sys_refcursor;
dataArray charArray;sSQL := 'select * from table_name'; open theCursor for sSQL;loop
fetch theCursor into dataArray; -- 问题在这里, 我不知道取出的记录有多少个字段, 怎么搞?
if theCursor%notfound then
exit;
end if;
for i in 1 .. dataArray.count loop
dbms_output.put_line(dataArray(i));
end loop;
end loop;
不知道table的字段数的情况下, 想实现动态查找. 请高手指点下
theCursor sys_refcursor;
dataArray charArray;sSQL := 'select * from table_name'; open theCursor for sSQL;loop
fetch theCursor into dataArray; -- 问题在这里, 我不知道取出的记录有多少个字段, 怎么搞?
if theCursor%notfound then
exit;
end if;
for i in 1 .. dataArray.count loop
dbms_output.put_line(dataArray(i));
end loop;
end loop;
不知道table的字段数的情况下, 想实现动态查找. 请高手指点下
举一个例子!
table_name colum_name
1 123
1 456
1 789
2 321
2 345