Re: [cx-oracle-users] ORA-13032 when trying to update a SDO_GEOMETRY column
Brought to you by:
atuining
From: Anthony T. <ant...@gm...> - 2018-03-19 20:38:59
|
Hi Matt, Are you able to test using the InsertGeometry.py sample? Or is it just this particular script that is failing and other scripts manipulating SDO_GEOMETRY are working fine for you? I just tried using this using cx_Oracle 6.2.1 with Oracle Client/Database 12.2 and did not experience the same problems you are. Anthony On Mon, Mar 19, 2018 at 6:47 AM, Matt <ma...@re...er> wrote: > 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 > > > > > > ------------------------------------------------------------ > ------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > > |