declare
type sallist is table of test1.id%type;
sals sallist;
begin
select id
bulk collect into sals
from test1
where rownum <= 10;
end;
-------
请教bulk collect作用。
sals值怎样拿。
type sallist is table of test1.id%type;
sals sallist;
begin
select id
bulk collect into sals
from test1
where rownum <= 10;
end;
-------
请教bulk collect作用。
sals值怎样拿。
要取得sals的值,可以这样:FOR i IN 1..sals.count LOOP
v_param := sals(i);
dbms_output.put_line(v_param);
END LOOP;