Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2003
    Posts
    2

    Unanswered: Very Urgent help required !!!!!

    Hi,

    I was trying to select a bulk data from a table using BULK COLLECTION feature of Oracle 9i. And i was trying with this code

    DECLARE
    TYPE test1_tab IS TABLE OF test1%ROWTYPE;

    t_tab test1_tab := test1_tab();
    BEGIN
    SELECT id, description
    BULK COLLECT INTO t_tab
    FROM test1;
    END;
    /
    but its giving error like

    ERROR at line 7:
    ORA-06550: line 7, column 21:
    PLS-00597: expression 'T_TAB' in the INTO list is of wrong type
    ORA-06550: line 8, column 3:
    PL/SQL: ORA-00904: invalid column name
    ORA-06550: line 6, column 3:
    PL/SQL: SQL Statement ignored

    But if i try it like this..
    i.e creating table of each column

    DECLARE
    TYPE test1_id IS TABLE OF test1.id%TYPE;
    TYPE test1_desc IS TABLE OF test1.description%TYPE;

    t_tab test1_tab := test1_tab();
    BEGIN
    SELECT id, description
    BULK COLLECT INTO test1_id,test1_desc
    FROM test1;
    END;
    /

    its working fine.....

    Problem is that i have to select a chunk of data from a table of 35 coloumns. Can any one help me what exactly is the problem.
    I am trying this one on Oracle 9.0.1.1.1 and i copied that above code from a well known PL/SQL book.

    Thanks

  2. #2
    Join Date
    Dec 2003
    Location
    India
    Posts
    7
    In your first example you have defined test1_tab as test1%ROWTYPE
    Collections of records cannot be a target of a BULK COLLECT INTO clause.

Posting Permissions

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