继我的上一个问题(Oracle PL/SQL中的表变量?)之后......
一旦你有一个数组/表中的值,你如何让它们再次退出?最好使用select语句或类似的东西?
这是我到目前为止所得到的:
declare
type array is table of number index by binary_integer;
pidms array;
begin
for i in (
select distinct sgbstdn_pidm
from sgbstdn
where sgbstdn_majr_code_1 = 'HS04'
and sgbstdn_program_1 = 'HSCOMPH'
)
loop
pidms(pidms.count+1) := i.sgbstdn_pidm;
end loop;
select *
from pidms; --ORACLE DOESN'T LIKE THIS BIT!!!
end;
Run Code Online (Sandbox Code Playgroud)
我知道我可以使用dbms_output.putline()输出它们,但我希望得到一个像我从任何其他表中选择的结果集.
先谢谢,马特