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;
正如你所看到的,每次我在循環50次。有一個更好的方法嗎?就像BULK COLLECT INTO?我將如何實現?
此行爲介紹10g。 – 2010-07-01 05:16:28