oracle / python-cx_Oracle

Python interface to Oracle Database now superseded by python-oracledb
https://oracle.github.io/python-cx_Oracle
Other
890 stars 361 forks source link

SDO_GEOMETRY throws java error on little endian WKB? #345

Closed pogson closed 5 years ago

pogson commented 5 years ago

According to the documentation this should work.

SELECT SDO_GEOMETRY(HEXTORAW('0102000000030000009FD921FD6F4858C0CC4362115FF448401730C19D874858C0936C8A8B64F4484099E9623E8A4858C0495F69A652F44840')) FROM DUAL

It throws an en exception

ORA-29532: Java call terminated by uncaught Java exception: java.lang.RuntimeException: -2
ORA-06512: at "MDSYS.SDO_JAVA_STP", line 79
ORA-06512: at "MDSYS.SDO_UTIL", line 5764
ORA-06512: at "MDSYS.SDO_GEOMETRY", line 180
ORA-06512: at line 1

The strange thing is that this works.

SELECT SDO_UTIL.FROM_WKBGEOMETRY(HEXTORAW('0102000000030000009FD921FD6F4858C0CC4362115FF448401730C19D874858C0936C8A8B64F4484099E9623E8A4858C0495F69A652F44840')) FROM DUAL;

This error occurs regardless of how the query is run. I've tried Python, DataGrip, or SQLDeveloper.

Python 3.6.7 cx-Oracle 7.1.3 Oracle Instant Client 12.2.0.1.0 Oracle Database 12c Standard Edition Release 12.2.0.1.0

cjbj commented 5 years ago

@pogson there doesn't appear to be a cx_Oracle angle to that issue but let me tag @dlapp to see if he can comment. Otherwise, you may want to ask the question on a forum where Spatial experts hang out.

You may also be interested in this comment about performance: https://github.com/oracle/python-cx_Oracle/issues/305#issuecomment-493494562

dlapp commented 5 years ago

@pogson Please post your question here: https://community.oracle.com/community/groundbreakers/database/oracle-database-options/spatial

cjbj commented 5 years ago

Thanks @dlapp

I'll close this issue.