Skip to Main Content

Java and JavaScript in the Database

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Publishing a Java class via pl/sql: inconsistent datatypes error

Simon GreenerAug 22 2011 — edited Aug 22 2011
Folks,

I'm driving myself nuts.

I have a PL/SQL package called GEOPROCESS that contains a function:
 Function Intersection(p_geom1 in mdsys.sdo_geometry,
                       p_geom2 in mdsys.sdo_geometry,
                       p_precision in number)
 Return mdsys.sdo_geometry
 As language java name
 'com.spatialdbadvisor.dbutils.ora.GeoProcessing.Intersection(oracle.sql.STRUCT,oracle.sql.STRUCT,int) return oracle.sql.STRUCT';
Note that it is defined over a Java method Intersection in a class called GeoProcessing.

For completeness the method is:
public static oracle.sql.STRUCT Intersection(oracle.sql.STRUCT _geom1, 
                                             oracle.sql.STRUCT _geom2, 
                                             int _precision)
 throws SQLException
{
   setPrecisionScale(_precision);
   return Overlay(_geom1, _geom2, OverlayOp.INTERSECTION);
}
Now, this method has worked fine now for quite a long time.

I changed the jar file that class was a member of by adding in a lot more classes.

Now, whenever I execute the Intersection function in SQL:
select geoprocess.Intersection(mdsys.sdo_geometry(2003,82469,NULL,sdo_elem_info_array(1,1003,3),sdo_ordinate_array(1,1,10,10)),
                               mdsys.sdo_geometry(2003,82469,NULL,sdo_elem_info_array(1,1003,3),sdo_ordinate_array(5,5,15,15)),
                               1) as rGeom
 from dual;
I get:
ORA-00932: inconsistent datatypes: expected an IN argument at position 1 that is an instance of an Oracle type convertible to an instance of a user defined Java class got an Oracle type that could not be converted to a java class
ORA-06512: at "CODESYS.GEOPROCESS", line 25
00932. 00000 - "inconsistent datatypes: expected %s got %s"
*Cause: 
*Action:
This error does not appear in udump.

I am completely and utterly stumped as to what is causing the problem. Previously, all mdsys.sdo_geometry object type values
were successfully passed to the method in the databases, executed and returned. Now it appears that some sort of conversion
is being attempted which previously never happened.

Can anyone point me to how to go about finding a solution?

regards
Simon
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 19 2011
Added on Aug 22 2011
1 comment
357 views