昏倒,看不出问题的问题
下面这段代码中两次打印应该打印出一样的结果,可是前一个13,后一个0,大家帮忙看看问题出在哪里呀?
declare
TYPE t_channelInfo is Record
(
channelid channel.channelid%TYPE
);
TYPE Table_cursorRef IS REF CURSOR return t_channelInfo;
type t_childnum is table of channel.channelid%Type index by binary_integer;
type t_childinfo is table of t_childnum index by binary_integer;
type t_totalinfo is table of t_channelInfo index by binary_integer;
p_vchildinfo t_childinfo;
p_nchildnum t_childnum;
p_totalinfo t_totalinfo;
p_cursor Table_cursorRef;
aa number;
begin
select count(channelid) into aa from channel where channel.fatherchannelid = 0;
Dbms_Output.Put_Line(to_char(aa));
open p_cursor for
select channelid from channel where channel.fatherchannelid = 0;
Dbms_Output.Put_Line(to_char(p_cursor%rowcount));
close p_cursor;
end;