Oracle:批量收集到“数字表”中给出“数字或值错误”
我在网上遇到过一个这样做的例子,它在我的数据库(10g)上也失败了,但这是我的版本。
...
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;
非常感谢您的帮助。
I've come across an example of doing this on the net which also fails 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
结果集为空。因此,您需要检查是否从 SELECT PROGRESS_RECID FROM ' || 中获得了一些结果。 v_表名 || v_where
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,