[cx-oracle-users] ORA-13032 when trying to update a SDO_GEOMETRY column
Brought to you by:
atuining
|
From: Matt <ma...@re...> - 2018-03-19 12:47:17
|
Hi,
I’m using cx_oracle in a little Python script to import / update Spatial data in a table column (column type MDSYS.SDO_GEOMETRY). This worked pretty well for more than a year, until I faced now the following error message:
ORA-29877: failed in the execution of the ODCIINDEXUPDATE routine
ORA-13032: Invalid NULL SDO_GEOMETRY object
ORA-06512: at "MDSYS.SDO_INDEX_METHOD_10I", line 480
My script was trying to execute an UPDATE statement to update the content of the SDO_GEOMETRY column based on the following source information:
<SDO_GEOMETRY>
<SDO_GTYPE>2001</SDO_GTYPE>
<SDO_SRID />
<SDO_POINT>
<X>0</X>
<Y>0</Y>
<Z />
</SDO_POINT>
<SDO_ELEM_INFO />
<SDO_ORDINATES />
</SDO_GEOMETRY>
Based on this data, my cx_oracle SDO_GEOMETRY object would be initialized with the following data:
typeObj = dbConn.gettype("MDSYS.SDO_GEOMETRY")
obj = typeObj.newobject()
obj.SDO_GTYPE = 2001
obj.SDO_POINT = pointTypeObj.newobject()
obj.SDO_POINT.X = 0
obj.SDO_POINT.Y = 0
obj.SDO_POINT.Z = None
and an UPDATE like the following will be executed afterwards with the geometry object and the ID of the record in the database:
UPDATE data_user.sdo_table SET geometry_data = :1 WHERE id = :2
This will cause the mentioned Oracle error stack (for only this record):
ORA-29877: failed in the execution of the ODCIINDEXUPDATE routine
ORA-13032: Invalid NULL SDO_GEOMETRY object
ORA-06512: at "MDSYS.SDO_INDEX_METHOD_10I", line 480
When I’m executing the update manually in SQL*Plus this works fine:
UPDATE data_user.sdo_table SET geometry_data = SDO_GEOMETRY(2001, NULL, SDO_POINT_TYPE(0, 0, NULL), NULL, NULL) where id = 100001;
Not sure if I missed something if there is no data for Z, if this has something to do with my Oracle version or if this could be cx_oracle related.
Thanks a lot for any hint / help in advance!
Best,
Matt
|