Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> varray and nested table questions

varray and nested table questions

From: Alan Sze <alan_at_icon.com.hk>
Date: Tue, 30 Nov 1999 18:03:35 +0800
Message-ID: <8206st$sor$1@news.hk.linkage.net>

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'

 )
IS

    array_char CharArrayType;
    array_num NumArrayType;

    v_i                binary_integer;
    CURSOR cur_a IS
        SELECT ... FROM ... WHERE ...;

BEGIN
    v_i := 1;
    LOOP
        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 LOOP;
....
....

END procA;

END packageA; Received on Tue Nov 30 1999 - 04:03:35 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US