小编Meh*_*hur的帖子

如何在oracle中将csv转换为表

在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.内置有什么东西吗?

csv string oracle plsql tokenize

10
推荐指数
3
解决办法
1万
查看次数

如何在Oracle中使用批量收集而不是循环

我在我的程序中有一个类似下面的示例查询:

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这样的东西?我该如何实现呢?

oracle plsql

1
推荐指数
1
解决办法
1万
查看次数

标签 统计

oracle ×2

plsql ×2

csv ×1

string ×1

tokenize ×1