Hi,
I am getting the error expression of wrong type when i try to compile the following procedure.

SQL> declare
2
3 cursor c1 is select phone_type_id from lkp_phone_type;
4
5 type phone_type_id_list is table of Number index by binary_integer;
6 p_phone_type_id phone_type_id_list;
7
8 begin
9 for i in c1 loop
10 p_phone_type_id(i) := i.phone_type_id;
11 end loop;
12
13
14 end;
15 /
p_phone_type_id(i) := i.phone_type_id;
*
ERROR at line 10:
ORA-06550: line 10, column 19:
PLS-00382: expression is of wrong type
ORA-06550: line 10, column 3:
PL/SQL: Statement ignored


Please note that the phone_type_id column in the table lkp_phone_type is a NUMBER datatype field.

whats wrong here.
when i change the for loop to

for i in 1..100 loop
p_phone_type_id(i) := i;
end loop;

it works , although it does not solve my problem of what i want to do but whats happenning, I have no clue.

Please Please Suggest. Its urgent


Ronnie

[Edited by ronnie on 11-20-2001 at 04:23 PM]