Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Collection of Oracle objects ORA-06531
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 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 Wed Dec 13 2000 - 18:33:36 CST