开发者

Oracle: Bulk collect into "table of number" gives "numeric or value error"

开发者 https://www.devze.com 2022-12-18 03:33 出处:网络
I\'ve come across an example of doing this on the net which also f开发者_运维问答ails on my DB (10g) but here\'s my version.

I've come across an example of doing this on the net which also f开发者_运维问答ails on my DB (10g) but here's my version.

...
TYPE prog_rec_type IS TABLE OF NUMBER INDEX BY PLS_INTEGER;

prog_rec_list prog_rec_type;

begin

...

EXECUTE IMMEDIATE 'SELECT PROGRESS_RECID FROM ' || v_table_name || v_where BULK COLLECT INTO prog_rec_list;


--ERROR FOUND IN THIS SECTION
FOR i IN prog_rec_list.FIRST..prog_rec_list.LAST
LOOP


--DBMS_OUTPUT.PUT_LINE('FOR LOOP: ' || i);

null;

END LOOP;

...
END;

Much appreciate the help.


The result set is empty. So you need to check that you got some results from that SELECT PROGRESS_RECID FROM ' || v_table_name || v_where


you may try this,

FOR i IN 1 .. prog_rec_list.COUNT LOOP
..
END LOOP
0

精彩评论

暂无评论...
验证码 换一张
取 消