ORA-06502: PL/SQL: numeric or value error: NULL index table key value
447194Aug 25 2005 — edited Aug 25 2005SQL> ed
Wrote file afiedt.buf
1 create or replace procedure ex
2 as
3 type aa is table of emp%rowtype index by binary_integer;
4 rec aa;
5 begin
6 FOR i IN (SELECT *
7 FROM emp)
8 LOOP
9 rec (SQL%ROWCOUNT) := i;
10 END LOOP;
11 FORALL indx IN rec.FIRST .. rec.LAST
12 INSERT INTO aa VALUES rec(indx);
13* end;
SQL> /
Procedure created.
SQL> create table aa as select * from emp where 0=9;
Table created.
SQL> execute ex;
BEGIN ex; END;
*
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error: NULL index table key value
ORA-06512: at "SCOTT.EX", line 9
ORA-06512: at line 1
Here I am trying to insert all rows from emp table to aa table but I am getting above error can help me out what kind of error that is.