在csv值中传递时,如何创建以表格格式返回结果的包.
select * from table(schema.mypackage.myfunction('one, two, three'))
Run Code Online (Sandbox Code Playgroud)
应该回来
one
two
three
Run Code Online (Sandbox Code Playgroud)
我试过问汤姆但是只适用于sql类型.
我正在使用oracle 11g.内置有什么东西吗?
我在我的程序中有一个类似下面的示例查询:
result_rec mypkg.mytype;
OPEN CUR1 FOR
select col1, col2, col3 from table1 where something = 'a'; --rows will always be 50
LOOP
FETCH CUR1
INTO myrectype;
EXIT WHEN CUR1%NOTFOUND;
result_rec.col1 := myrectype.col1;
result_rec.col2 := myrectype.col2;
result_rec.col3 := myrectype.col3;
PIPE ROW (result_rec);
END LOOP;
Run Code Online (Sandbox Code Playgroud)
正如你所看到的,每次我循环50次.有一个更好的方法吗?像BULK COLLECT INTO这样的东西?我该如何实现呢?