associative arrays containing record type, can not use FIRST
756932Mar 1 2010 — edited Mar 1 2010I 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;
/