Hi Everyone,
I am using Oracle version 12c.
I am getting the below error when i run the following code. It is contains a nested table variable inside a record variable. The table variable can have more then one rows and record variable can have more than one column.
set serveroutput on
declare
l_err_msg varchar2(4000);
TYPE dc_code_tab_type IS TABLE OF varchar2(10);
TYPE typ1 IS RECORD
(
dc_code dc_code_tab_type
);
a_typ1 typ1;
begin
a_typ1.dc_code.extend;
a_typ1.dc_code(1) := '15';
end;
/
Error report -
ORA-06531: Reference to uninitialized collection
ORA-06512: at line 18
06531. 00000 - "Reference to uninitialized collection"
*Cause: An element or member function of a nested table or varray
was referenced (where an initialized collection is needed)
without the collection having been initialized.
*Action: Initialize the collection with an appropriate constructor
or whole-object assignment.
Thanks
Gautam