Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

associative arrays containing record type, can not use FIRST

756932Mar 1 2010 — edited Mar 1 2010
I am having troubles with declaring an Associative Array containing Record Types, and iterating though it using FIRST and NEXT functions.
This problem of mine is only showing up when I use Record Types, the FIRST and NEXT operators work out just fine when using regular NUMBER.

When trying to get the first element in the array I get: ORA-06550: line 22, column 40: PLS-00382: expression is of wrong type

See code snippet below. Anybody know if this can be done in PL/SQL?

-----------------------------------------------------------------------------------------
DECLARE


-- Define the record structure that will contain info on a post
TYPE PostRec IS RECORD (
post_type VARCHAR2(4) -- Can be DEB/CRED
);

lr_charge_back_post PostRec;

TYPE post_table IS TABLE OF PostRec NOT NULL
INDEX BY VARCHAR2(4);

assoc_posts post_table;

BEGIN


--lr_charge_back_post.post_type := 'asd';
assoc_posts('1').post_type := '1';

lr_charge_back_post := assoc_posts.first;

END;
/
This post has been answered by 730428 on Mar 1 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 29 2010
Added on Mar 1 2010
2 comments
554 views