ORA-13032 when trying to update a SDO_GEOMETRY column
Matt <matt-YbqNKg/[email protected]> Mon, 19 Mar 2018 13:47:07 +0100
| Newsgroups | gmane.comp.python.db.cx-oracle |
|---|---|
| Message-ID | <[email protected]> |
> This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
--===============3607360215682885990==
Content-type: multipart/alternative;
boundary="B_3604312028_778975621"
> This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
--B_3604312028_778975621
Content-type: text/plain;
charset="UTF-8"
Content-transfer-encoding: quoted-printable
Hi,
=20
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 pretty =
well for more than a year, until I faced now the following error message:
=20
ORA-29877: failed in the execution of the ODCIINDEXUPDATE routine
ORA-13032: Invalid NULL=C2=A0 SDO_GEOMETRY object
ORA-06512: at "MDSYS.SDO_INDEX_METHOD_10I", line 480
=20
My script was trying to execute an UPDATE statement to update the content o=
f the SDO_GEOMETRY column based on the following source information:
=20
<SDO_GEOMETRY>
=C2=A0 <SDO_GTYPE>2001</SDO_GTYPE>
=C2=A0 <SDO_SRID />
=C2=A0 <SDO_POINT>
=C2=A0=C2=A0=C2=A0 <X>0</X>
=C2=A0=C2=A0=C2=A0 <Y>0</Y>
=C2=A0=C2=A0=C2=A0 <Z />
=C2=A0 </SDO_POINT>
=C2=A0 <SDO_ELEM_INFO />
=C2=A0 <SDO_ORDINATES />
</SDO_GEOMETRY>
=20
Based on this data, my cx_oracle SDO_GEOMETRY object would be initialized w=
ith the following data:
=20
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
=20
and an UPDATE like the following will be executed afterwards with the geome=
try object and the ID of the record in the database:
=20
UPDATE data_user.sdo_table SET geometry_data =3D :1 WHERE id =3D :2
=20
This will cause the mentioned Oracle error stack (for only this record):
=20
ORA-29877: failed in the execution of the ODCIINDEXUPDATE routine
ORA-13032: Invalid NULL=C2=A0 SDO_GEOMETRY object
ORA-06512: at "MDSYS.SDO_INDEX_METHOD_10I", line 480
=20
When I=E2=80=99m executing the update manually in SQL*Plus this works fine:
=20
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;
=20
Not sure if I missed something if there is no data for Z, if this has somet=
hing to do with my Oracle version or if this could be cx_oracle related.
=20
Thanks a lot for any hint / help in advance!
=20
Best,
Matt
=20
=20
--B_3604312028_778975621
Content-type: text/html;
charset="UTF-8"
Content-transfer-encoding: quoted-printable
<html xmlns:o=3D"urn:schemas-microsoft-com:office:office" xmlns:w=3D"urn:schema=
s-microsoft-com:office:word" xmlns:m=3D"http://schemas.microsoft.com/office/20=
04/12/omml" xmlns=3D"http://www.w3.org/TR/REC-html40"><head><meta http-equiv=3DC=
ontent-Type content=3D"text/html; charset=3Dutf-8"><meta name=3DGenerator content=3D=
"Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style></head><body lang=3DEN-US link=3D"#0563C1" vlink=3D"#954F72"><div clas=
s=3DWordSection1><p class=3DMsoNormal><span style=3D'font-size:11.0pt'>Hi,<o:p></o=
:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt'><o:p> <=
/o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt'>I=E2=80=99m usin=
g cx_oracle in a little Python script to import / update Spatial data in a t=
able column (column type MDSYS.SDO_GEOMETRY). This worked pretty well for mo=
re than a year, until I faced now the following error message:<o:p></o:p></s=
pan></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt'><o:p> </o:p><=
/span></p><p class=3DMsoNormal><span style=3D'font-size:10.0pt;font-family:Conso=
las'>ORA-29877: failed in the execution of the ODCIINDEXUPDATE routine<o:p><=
/o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:10.0pt;font-family=
:Consolas'>ORA-13032: Invalid NULL=C2=A0 SDO_GEOMETRY object<o:p></o:p></span></=
p><p class=3DMsoNormal><span style=3D'font-size:10.0pt;font-family:Consolas'>ORA=
-06512: at "MDSYS.SDO_INDEX_METHOD_10I", line 480</span><span styl=
e=3D'font-size:11.0pt'><o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'f=
ont-size:11.0pt'><o:p> </o:p></span></p><p class=3DMsoNormal><span style=3D=
'font-size:11.0pt'>My script was trying to execute an UPDATE statement to up=
date the content of the SDO_GEOMETRY column based on the following source in=
formation:<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11=
.0pt'><o:p> </o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:=
10.0pt;font-family:Consolas'><SDO_GEOMETRY><o:p></o:p></span></p><p cl=
ass=3DMsoNormal><span style=3D'font-size:10.0pt;font-family:Consolas'>=C2=A0 <SDO=
_GTYPE>2001</SDO_GTYPE><o:p></o:p></span></p><p class=3DMsoNormal><sp=
an style=3D'font-size:10.0pt;font-family:Consolas'>=C2=A0 <SDO_SRID /><o:p><=
/o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:10.0pt;font-family=
:Consolas'>=C2=A0 <SDO_POINT><o:p></o:p></span></p><p class=3DMsoNormal><spa=
n style=3D'font-size:10.0pt;font-family:Consolas'>=C2=A0=C2=A0=C2=A0 <X>0</X><=
o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:10.0pt;font-f=
amily:Consolas'>=C2=A0=C2=A0=C2=A0 <Y>0</Y><o:p></o:p></span></p><p class=3DMs=
oNormal><span style=3D'font-size:10.0pt;font-family:Consolas'>=C2=A0=C2=A0=C2=A0 <Z /&g=
t;<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:10.0pt;fon=
t-family:Consolas'>=C2=A0 </SDO_POINT><o:p></o:p></span></p><p class=3DMsoNo=
rmal><span style=3D'font-size:10.0pt;font-family:Consolas'>=C2=A0 <SDO_ELEM_INF=
O /><o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:10.0p=
t;font-family:Consolas'>=C2=A0 <SDO_ORDINATES /><o:p></o:p></span></p><p c=
lass=3DMsoNormal><span style=3D'font-size:10.0pt;font-family:Consolas'></SDO_=
GEOMETRY><o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:=
11.0pt'><o:p> </o:p></span></p><p class=3DMsoNormal><span style=3D'font-siz=
e:11.0pt'>Based on this data, my cx_oracle SDO_GEOMETRY object would be init=
ialized with the following data:<o:p></o:p></span></p><p class=3DMsoNormal><sp=
an style=3D'font-size:11.0pt'><o:p> </o:p></span></p><p class=3DMsoNormal><=
span style=3D'font-size:10.0pt;font-family:Consolas'>typeObj =3D dbConn.gettype(=
"MDSYS.SDO_GEOMETRY")<o:p></o:p></span></p><p class=3DMsoNormal><spa=
n style=3D'font-size:10.0pt;font-family:Consolas'>obj =3D typeObj.newobject()<o:=
p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:10.0pt;font-fam=
ily:Consolas'>obj.SDO_GTYPE =3D 2001<o:p></o:p></span></p><p class=3DMsoNormal><=
span style=3D'font-size:10.0pt;font-family:Consolas'>obj.SDO_POINT =3D pointType=
Obj.newobject()<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-si=
ze:10.0pt;font-family:Consolas'>obj.SDO_POINT.X =3D 0<o:p></o:p></span></p><p =
class=3DMsoNormal><span style=3D'font-size:10.0pt;font-family:Consolas'>obj.SDO_=
POINT.Y =3D 0<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:1=
0.0pt;font-family:Consolas'>obj.SDO_POINT.Z =3D None<o:p></o:p></span></p><p c=
lass=3DMsoNormal><span style=3D'font-size:11.0pt'><o:p> </o:p></span></p><p=
class=3DMsoNormal><span style=3D'font-size:11.0pt'>and an UPDATE like the follo=
wing will be executed afterwards with the geometry object and the ID of the =
record in the database:<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D=
'font-size:11.0pt'><o:p> </o:p></span></p><p class=3DMsoNormal><span styl=
e=3D'font-size:10.0pt;font-family:Consolas'>UPDATE data_user.sdo_table SET geo=
metry_data =3D :1 WHERE id =3D :2<o:p></o:p></span></p><p class=3DMsoNormal><span =
style=3D'font-size:11.0pt'><o:p> </o:p></span></p><p class=3DMsoNormal><spa=
n style=3D'font-size:11.0pt'>This will cause the mentioned Oracle error stack =
(for only this record):<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D=
'font-size:11.0pt'><o:p> </o:p></span></p><p class=3DMsoNormal><span styl=
e=3D'font-size:10.0pt;font-family:Consolas'>ORA-29877: failed in the execution=
of the ODCIINDEXUPDATE routine<o:p></o:p></span></p><p class=3DMsoNormal><spa=
n style=3D'font-size:10.0pt;font-family:Consolas'>ORA-13032: Invalid NULL=C2=A0 SD=
O_GEOMETRY object<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-=
size:10.0pt;font-family:Consolas'>ORA-06512: at "MDSYS.SDO_INDEX_METHOD=
_10I", line 480</span><span style=3D'font-size:11.0pt'><o:p></o:p></span>=
</p><p class=3DMsoNormal><span style=3D'font-size:11.0pt'><o:p> </o:p></spa=
n></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt'>When I=E2=80=99m executing=
the update manually in SQL*Plus this works fine:<o:p></o:p></span></p><p cl=
ass=3DMsoNormal><span style=3D'font-size:11.0pt'><o:p> </o:p></span></p><p =
class=3DMsoNormal><span style=3D'font-size:10.0pt;font-family:Consolas'>UPDATE d=
ata_user.sdo_table SET geometry_data =3D SDO_GEOMETRY(2001, NULL, SDO_POINT_TY=
PE(0, 0, NULL), NULL, NULL) where id =3D 100001;</span><span style=3D'font-size:=
11.0pt'><o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0=
pt'><o:p> </o:p></span></p><p class=3DMsoNormal><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=
.<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt'><o:=
p> </o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt'>T=
hanks a lot for any hint / help in advance!<o:p></o:p></span></p><p class=3DMs=
oNormal><span style=3D'font-size:11.0pt'><o:p> </o:p></span></p><p class=3D=
MsoNormal><span style=3D'font-size:11.0pt'>Best,<o:p></o:p></span></p><p class=
=3DMsoNormal><span style=3D'font-size:11.0pt'>Matt<o:p></o:p></span></p><p class=
=3DMsoNormal><span style=3D'font-size:11.0pt'><o:p> </o:p></span></p><p cla=
ss=3DMsoNormal><o:p> </o:p></p></div></body></html>
--B_3604312028_778975621--
--===============3607360215682885990==
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
--===============3607360215682885990==
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
--===============3607360215682885990==--