DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: PLS-00382: expression is of wrong type: Please Help

  1. #1
    Join Date
    Mar 2001
    Location
    New York , New York
    Posts
    577
    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]

  2. #2
    Join Date
    Oct 2000
    Location
    Saskatoon, SK, Canada
    Posts
    3,925
    That is because the when you insert the data into the PLSQL table, there has to be an order of sequence..

    Code:
      v_count := 0;               -- Remember to decaler v_count NUMBER (20) := 0;
      FOR i IN c1 LOOP
         v_count := v_count + 1;
         p_phone_type_id(v_count) := i.phone_type_id; 
      END LOOP;
    Sam
    Thanx
    Sam



    Life is a journey, not a destination!


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width