Collection of Oracle Objects ORA-06531

From: Chuck Clifford <ccliffor_at_ix.netcom.com>
Date: Wed, 13 Dec 2000 19:18:55 -0500
Message-ID: <9193f1$ish$1_at_nntp9.atl.mindspring.net>


I used JDeveloper to generate custom classes for an Oracle package. In that package, a function returns an array (of Oracle objects). JDeveloper created the custom class for the package(sitepkg.sqlj), and 3 additional custom classes to support the referenced Oracle object collections(Physicallocobj.sqlj - this is the Oracle object; PhysicallocobjRef.java; Physicallocobjtbl.java - this is the collection of the Oracle object).
I import the files into my program:

import DBAInfo1.sitepkg;
import DBAInfo1.Physicallocobj;
import DBAInfo1.PhysicallocobjRef;
import DBAInfo1.Physicallocobjtbl;

I declare the corresponding variables:
public static sitepkg SiteDBI = null;
public static Physicallocobjtbl SiteList = null;

I initialize the variables:
SiteDBI = new sitepkg();
SiteList = new Physicallocobjtbl();

And when I invoke a method of the SiteDBI object, the ORA-06531 error is raised
SiteList = SiteDBI.ListSites();

The error message is as follows:

)RA-06531: Reference to uninitialized collection
ORA-06512: at "WEBDEVADMIN.SITEPKG", line 81
ORA-06512: at line 1

The method definition for ListSites is as follows:

public Physicallocobjtbl ListSites ()
throws SQLException
{
Physicallocobjtbl __jPt_result;
#sql [_ctx] __jPt_result = { VALUES(SITEPKG.FLISTSITES()) }; return __jPt_result;
}

How does one correctly initialize the collection? Received on Thu Dec 14 2000 - 01:18:55 CET

Original text of this message