create or replace procedure TestJiaoJi
is
type nt_table_type is table of number;
nt1 nt_table_type:=nt_table_type(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
nt2 nt_table_type:=nt_table_type(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
result nt_table_type;
iTotalNum integer:=0;--¼Ç¼½»¼¯¸öÊý,²»°üÀ¨0
begin
for n in 1..5
loop
nt1(n) :=n;
nt2(n) :=n+2;
end loop;
result:=nt1 multiset intersect nt2;--Çó½»¼¯
dbms_output.put_line('½»¼¯ÊÇ:');
for i in 1..result.count
loop
if(result(i)!=0) then
iTotalNum:=iTotalNum+1;
dbms_output.put_line(''||result(i));
end if;
end loop;
if result.count>0 then
dbms_output.put_line('°üÀ¨0ÔÚÄÚµÄÔªËØ¸öÊýΪ:'||result.count);
end if;
if iTotalNum>0 then
dbms_output.put_line('²»°üÀ¨0ÔÚÄÚµÄÔªËØ¸öÊýΪ:'||iTotalNum);
end if;
--dbms_output.new_line;
end TestJiaoJi;