|
-
Initialisation of VARRAY of RECORDs
How do I initialise a VARRAY of RECORDS using literals?
If I define the record using:
TYPE t_myrecord IS RECORD (
field1 varchar2(5),
field2 varchar2(5),
field3 varchar2(5) );
and then define the array type:
TYPE t_myarray IS VARRAY(20) OF
t_myrecord;
and then define and initialise the array using:
a_myarray t_myarray := t_myarray();
where all of the above is listed between the DECLARE and first BEGIN statements, any attempt to assign values to the array within the BEGIN block gives either a 'VARRAY not initialised error' or 'wrong number or type of parameter into t_myarray' when using syntax like:
a_myarray(1) := t_myarray('a', 'b', 'c');
Also, the following syntax complains that t_myrecord is not defined:
a_myarray := t_myarray(
t_myrecord('a', 'b', 'c'),
t_myrecord('d', 'e', 'f'),
t_myrecord('g', 'h', 'i'));
Even if I use this last syntax in the DECLARE block.
Does anyone have any working examples?
I'm using Oracle 9.2.3.0 on an AIX 5L platform.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|