CREATE OR REPLACE package sysop as
type file_list_rec is record(filename varchar2(1024));
type file_list is table of file_list_rec;
function ls(v_directory varchar2) return file_list pipelined;
end;
/
CREATE OR REPLACE package body sysop as
function ls(v_directory varchar2) return file_list pipelined is
rec file_list_rec;
v_host_list varchar2(32000) := '';
begin
v_host_list := host_list(v_directory);
for file in (
select regexp_substr(v_host_list, '[^'||chr(10)||']+', 1, level)
from dual
connect by
regexp_substr(v_host_list, '[^'||chr(10)||']+', 1, level) is not null)
loop
pipe row (file);
end loop;
return;
end ls;
end sysop;
/
1条答案
按热度按时间3phpmpom1#
考虑使用记录类型、记录表和管道行。像这样的东西会有用吗?