Re: ORA-13032 when trying to update a SDO_GEOMETRY column
Anthony Tuininga <[email protected]> Mon, 19 Mar 2018 14:38:50 -0600
| Newsgroups | gmane.comp.python.db.cx-oracle |
|---|---|
| Message-ID | <CAE1XR-5bb3ryGEYwmm8Wj9tAuY+uRnObeNA-p0YR5_joQtZjnA@mail.gmail.com> |
--===============4879094531204043929== Content-Type: multipart/alternative; boundary="001a1140f1ee17da920567c9f2e7" --001a1140f1ee17da920567c9f2e7 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 <matt-YbqNKg/[email protected]> wrote: > Hi, > > > > I=E2=80=99m using cx_oracle in a little Python script to import / update = Spatial > data in a table column (column type MDSYS.SDO_GEOMETRY). This worked pret= ty > 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 =3D dbConn.gettype("MDSYS.SDO_GEOMETRY") > > obj =3D typeObj.newobject() > > obj.SDO_GTYPE =3D 2001 > > obj.SDO_POINT =3D pointTypeObj.newobject() > > obj.SDO_POINT.X =3D 0 > > obj.SDO_POINT.Y =3D 0 > > obj.SDO_POINT.Z =3D 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 =3D :1 WHERE id =3D :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=E2=80=99m executing the update manually in SQL*Plus this works fin= e: > > > > UPDATE data_user.sdo_table SET geometry_data =3D SDO_GEOMETRY(2001, NULL, > SDO_POINT_TYPE(0, 0, NULL), NULL, NULL) where id =3D 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-oracle-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > > --001a1140f1ee17da920567c9f2e7 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr">Hi Matt,<div><br></div><div>Are you able to test using the= InsertGeometry.py sample? Or is it just this particular script that is fai= ling 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 1= 2.2 and did not experience the same problems you are.</div><div><br></div><= div>Anthony</div></div><div class=3D"gmail_extra"><br><div class=3D"gmail_q= uote">On Mon, Mar 19, 2018 at 6:47 AM, Matt <span dir=3D"ltr"><<a href= =3D"mailto:matt-YbqNKg/[email protected]" target=3D"_blank">matt-YbqNKg/[email protected]</= a>></span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0= 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang=3D"EN-US" = link=3D"#0563C1" vlink=3D"#954F72"><div class=3D"m_2686623574689166539WordS= ection1"><p class=3D"MsoNormal"><span style=3D"font-size:11.0pt">Hi,<u></u>= <u></u></span></p><p class=3D"MsoNormal"><span style=3D"font-size:11.0pt"><= u></u>=C2=A0<u></u></span></p><p class=3D"MsoNormal"><span style=3D"font-si= ze:11.0pt">I=E2=80=99m using cx_oracle in a little Python script to import = / update Spatial data in a table column (column type MDSYS.SDO_GEOMETRY). T= his worked pretty well for more than a year, until I faced now the followin= g error message:<u></u><u></u></span></p><p class=3D"MsoNormal"><span style= =3D"font-size:11.0pt"><u></u>=C2=A0<u></u></span></p><p class=3D"MsoNormal"= ><span style=3D"font-size:10.0pt;font-family:Consolas">ORA-29877: failed in= the execution of the ODCIINDEXUPDATE routine<u></u><u></u></span></p><p cl= ass=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:Consolas">ORA= -13032: Invalid NULL=C2=A0 SDO_GEOMETRY object<u></u><u></u></span></p><p c= lass=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:Consolas">OR= A-06512: at "MDSYS.SDO_INDEX_METHOD_10I", line 480</span><span st= yle=3D"font-size:11.0pt"><u></u><u></u></span></p><p class=3D"MsoNormal"><s= pan style=3D"font-size:11.0pt"><u></u>=C2=A0<u></u></span></p><p class=3D"M= soNormal"><span style=3D"font-size:11.0pt">My script was trying to execute = an UPDATE statement to update the content of the SDO_GEOMETRY column based = on the following source information:<u></u><u></u></span></p><p class=3D"Ms= oNormal"><span style=3D"font-size:11.0pt"><u></u>=C2=A0<u></u></span></p><p= class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:Consolas">= <SDO_GEOMETRY><u></u><u></u></span></p><p class=3D"MsoNormal"><span s= tyle=3D"font-size:10.0pt;font-family:Consolas">=C2=A0 <SDO_GTYPE>2001= </SDO_GTYPE><u></u><u></u></span></p><p class=3D"MsoNormal"><span sty= le=3D"font-size:10.0pt;font-family:Consolas">=C2=A0 <SDO_SRID /><u></= u><u></u></span></p><p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;= font-family:Consolas">=C2=A0 <SDO_POINT><u></u><u></u></span></p><p c= lass=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:Consolas">= =C2=A0=C2=A0=C2=A0 <X>0</X><u></u><u></u></span></p><p class=3D= "MsoNormal"><span style=3D"font-size:10.0pt;font-family:Consolas">=C2=A0=C2= =A0=C2=A0 <Y>0</Y><u></u><u></u></span></p><p class=3D"MsoNorma= l"><span style=3D"font-size:10.0pt;font-family:Consolas">=C2=A0=C2=A0=C2=A0= <Z /><u></u><u></u></span></p><p class=3D"MsoNormal"><span style=3D"= font-size:10.0pt;font-family:Consolas">=C2=A0 </SDO_POINT><u></u><u><= /u></span></p><p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-f= amily:Consolas">=C2=A0 <SDO_ELEM_INFO /><u></u><u></u></span></p><p c= lass=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:Consolas">= =C2=A0 <SDO_ORDINATES /><u></u><u></u></span></p><p class=3D"MsoNorma= l"><span style=3D"font-size:10.0pt;font-family:Consolas"></SDO_GEOMETRY&= gt;<u></u><u></u></span></p><p class=3D"MsoNormal"><span style=3D"font-size= :11.0pt"><u></u>=C2=A0<u></u></span></p><p class=3D"MsoNormal"><span style= =3D"font-size:11.0pt">Based on this data, my cx_oracle SDO_GEOMETRY object = would be initialized with the following data:<u></u><u></u></span></p><p cl= ass=3D"MsoNormal"><span style=3D"font-size:11.0pt"><u></u>=C2=A0<u></u></sp= an></p><p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:C= onsolas">typeObj =3D dbConn.gettype("MDSYS.SDO_<wbr>GEOMETRY")<u>= </u><u></u></span></p><p class=3D"MsoNormal"><span style=3D"font-size:10.0p= t;font-family:Consolas">obj =3D typeObj.newobject()<u></u><u></u></span></p= ><p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:Consola= s">obj.SDO_GTYPE =3D 2001<u></u><u></u></span></p><p class=3D"MsoNormal"><s= pan style=3D"font-size:10.0pt;font-family:Consolas">obj.SDO_POINT =3D point= TypeObj.newobject()<u></u><u></u></span></p><p class=3D"MsoNormal"><span st= yle=3D"font-size:10.0pt;font-family:Consolas">obj.SDO_POINT.X =3D 0<u></u><= u></u></span></p><p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;fon= t-family:Consolas">obj.SDO_POINT.Y =3D 0<u></u><u></u></span></p><p class= =3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:Consolas">obj.SD= O_POINT.Z =3D None<u></u><u></u></span></p><p class=3D"MsoNormal"><span sty= le=3D"font-size:11.0pt"><u></u>=C2=A0<u></u></span></p><p class=3D"MsoNorma= l"><span style=3D"font-size:11.0pt">and an UPDATE like the following will b= e executed afterwards with the geometry object and the ID of the record in = the database:<u></u><u></u></span></p><p class=3D"MsoNormal"><span style=3D= "font-size:11.0pt"><u></u>=C2=A0<u></u></span></p><p class=3D"MsoNormal"><s= pan style=3D"font-size:10.0pt;font-family:Consolas">UPDATE data_user.sdo_ta= ble SET geometry_data =3D :1 WHERE id =3D :2<u></u><u></u></span></p><p cla= ss=3D"MsoNormal"><span style=3D"font-size:11.0pt"><u></u>=C2=A0<u></u></spa= n></p><p class=3D"MsoNormal"><span style=3D"font-size:11.0pt">This will cau= se the mentioned Oracle error stack (for only this record):<u></u><u></u></= span></p><p class=3D"MsoNormal"><span style=3D"font-size:11.0pt"><u></u>=C2= =A0<u></u></span></p><p class=3D"MsoNormal"><span style=3D"font-size:10.0pt= ;font-family:Consolas">ORA-29877: failed in the execution of the ODCIINDEXU= PDATE routine<u></u><u></u></span></p><p class=3D"MsoNormal"><span style=3D= "font-size:10.0pt;font-family:Consolas">ORA-13032: Invalid NULL=C2=A0 SDO_G= EOMETRY object<u></u><u></u></span></p><p class=3D"MsoNormal"><span style= =3D"font-size:10.0pt;font-family:Consolas">ORA-06512: at "MDSYS.SDO_IN= DEX_METHOD_10I", line 480</span><span style=3D"font-size:11.0pt"><u></= u><u></u></span></p><p class=3D"MsoNormal"><span style=3D"font-size:11.0pt"= ><u></u>=C2=A0<u></u></span></p><p class=3D"MsoNormal"><span style=3D"font-= size:11.0pt">When I=E2=80=99m executing the update manually in SQL*Plus thi= s works fine:<u></u><u></u></span></p><p class=3D"MsoNormal"><span style=3D= "font-size:11.0pt"><u></u>=C2=A0<u></u></span></p><p class=3D"MsoNormal"><s= pan style=3D"font-size:10.0pt;font-family:Consolas">UPDATE data_user.sdo_ta= ble SET geometry_data =3D SDO_GEOMETRY(2001, NULL, SDO_POINT_TYPE(0, 0, NUL= L), NULL, NULL) where id =3D 100001;</span><span style=3D"font-size:11.0pt"= ><u></u><u></u></span></p><p class=3D"MsoNormal"><span style=3D"font-size:1= 1.0pt"><u></u>=C2=A0<u></u></span></p><p class=3D"MsoNormal"><span style=3D= "font-size:11.0pt">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.<u></u><u></u></span></p><p class=3D"MsoNormal"><span style= =3D"font-size:11.0pt"><u></u>=C2=A0<u></u></span></p><p class=3D"MsoNormal"= ><span style=3D"font-size:11.0pt">Thanks a lot for any hint / help in advan= ce!<u></u><u></u></span></p><p class=3D"MsoNormal"><span style=3D"font-size= :11.0pt"><u></u>=C2=A0<u></u></span></p><p class=3D"MsoNormal"><span style= =3D"font-size:11.0pt">Best,<u></u><u></u></span></p><p class=3D"MsoNormal">= <span style=3D"font-size:11.0pt">Matt<u></u><u></u></span></p><p class=3D"M= soNormal"><span style=3D"font-size:11.0pt"><u></u>=C2=A0<u></u></span></p><= p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p></div></div> <br>------------------------------<wbr>------------------------------<wbr>-= -----------------<br> Check out the vibrant tech community on one of the world's most<br> engaging tech sites, Slashdot.org! <a href=3D"http://sdm.link/slashdot" rel= =3D"noreferrer" target=3D"_blank">http://sdm.link/slashdot</a><br>_________= _____________________<wbr>_________________<br> cx-oracle-users mailing list<br> <a href=3D"mailto:cx-oracle-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org">cx-oracle-users@li= sts.<wbr>sourceforge.net</a><br> <a href=3D"https://lists.sourceforge.net/lists/listinfo/cx-oracle-users" re= l=3D"noreferrer" target=3D"_blank">https://lists.sourceforge.net/<wbr>lists= /listinfo/cx-oracle-users</a><br> <br></blockquote></div><br></div> --001a1140f1ee17da920567c9f2e7-- --===============4879094531204043929== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot --===============4879094531204043929== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ cx-oracle-users mailing list cx-oracle-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org https://lists.sourceforge.net/lists/listinfo/cx-oracle-users --===============4879094531204043929==--