|
|
|
|
|
|
|
|
|
|
|
|
| Re: types of pl/sql value or numric error. [message #572216 is a reply to message #572215] |
Fri, 07 December 2012 08:08   |
 |
Michel Cadot
Messages: 54128 Registered: March 2007 Location: Nanterre, France, http://...
|
Senior Member Account Moderator |
|
|
Through away TOAD that does not help you in anyway and use SQL*PLus:
SQL> declare
2 vv varchar2(200):='select deptno,dname,loc from dept1';
3 type depp_tab is table of dept1%rowtype;
4 t_depp depp_tab;
5 begin
6 execute immediate vv bulk collect into t_depp;
7 for i in t_depp.first .. t_depp.last loop
8 insert into scott.dept values(t_depp(i).deptno,t_depp(i).dname,t_depp(i).loc);
9 end loop;
10 end;
11
12
13 /
declare
*
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at line 7
There is nothing in your table so FIRST and LAST are undefined.
Learn how to indent the code, it will also help you to write, understant and maintain your code.
If you don't know, use SQL Formatter.
Regards
Michel
|
|
|
|
|
|
|
|