Fetch from REF CURSOR Into Sting-Indexed Associative Array
Posted on 2007-04-02
It is my understanding that in Oracle 9i, you cannot BULK COLLECT into an associative array that is indexed by VARCHAR2.
So can someone help me with the syntax for fetching the values from a ref cursor into an array that is not indexed by BINARY_INTEGER? The following is a simple example for what I am trying to do, but in the final I will be passing the ref cursor as an argument.
TYPE emp_rec IS RECORD
TYPE emp_tab_type IS TABLE OF emp_rec
INDEX BY VARCHAR2(11);
TYPE rcur IS REF CURSOR;
OPEN rcur_birthday FOR
WHERE employee_birth_date = TRUNC(SYSDATE);
FETCH rcur_birthday BULK COLLECT INTO emp_tab;