Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> varray and nested table questions
Hope this is not a stupid question.
I've got
ORA-06531: Reference to uninitialized collection from the executing the following package.
Is that the nested table (or varray) need initialization?? If so, how??
And also, I wanna sort the arrays (array_char / array_num) descending. Any good sorting algorithm??
Thanks.
The package as follows:
CREATE OR REPLACE PACKAGE BODY packageA
AS
TYPE CharArrayType IS TABLE OF varchar2(10);
TYPE NumArrayType IS TABLE OF number;
PROCEDURE procA (
p_a IN number DEFAULT 0, p_b IN varchar2 DEFAULT 'NONE'
array_char CharArrayType;
array_num NumArrayType;
v_i binary_integer; CURSOR cur_a IS SELECT ... FROM ... WHERE ...;
FETCH cur_a INTO ...; EXIT WHEN cur_a%NOTFOUND; array_num(v_i) := value_a; array_char(v_i) := name_a; v_i := v_i + 1;
END packageA; Received on Tue Nov 30 1999 - 04:03:35 CST