Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Type problem

Status
Not open for further replies.

dbomrrsm

Programmer
Feb 20, 2004
1,709
GB
I have obtained the following as an example of womething more complex I am trying to do:
Code:
declare TYPE ARRAY IS TABLE OF all_objects%ROWTYPE;
l_data ARRAY;

CURSOR c IS
SELECT *
FROM all_objects;

BEGIN
    OPEN c;
    LOOP
    FETCH c BULK COLLECT INTO l_data LIMIT 100;

    FORALL i IN 1..l_data.COUNT
    INSERT INTO t2 VALUES l_data(i);

    EXIT WHEN c%NOTFOUND;
    END LOOP;
    CLOSE c;
END;

When I run it it errors with ORA-06550:expression 'L_DATA' in the INTO list is of wrong type.

Is it the version of Oracle I am using (8.1.7.4) that is causing this error or is there something wrong with the code.

TIA

[bandito] [blue]DBomrrsm[/blue] [bandito]

[blue]Software code, like laws and sausages, should never be examined in production[/blue][black] - [/black][purple]Edward Tenner[/purple]
 
It works correctly in Oracle 9. I've a feeling that bulk collect may not have worked with record types until 9. You might have to declare all your variables separately.

Or preferably upgrade, since Oracle 8 is ancient and unsupported.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top