How to read a cx_Oracle.OBJECT with type cx_Oracle.ObjectType SYS.XMLTYPE?

痞子三分冷 提交于 2020-01-06 14:09:08

问题


I'm trying read the content of a XMLType column from Oracle with cx_Oracle but i don't get it.

>>> row
(318, 379, 1, <cx_Oracle.OBJECT object at 0xef21ea0>)
>>> col = row[3]
>>> print col
<cx_Oracle.OBJECT object at 0xef21ea0>
>>> print col.type
<cx_Oracle.ObjectType SYS.XMLTYPE>

How can I read the content of a cx_Oracle.OBJECT with type cx_Oracle.ObjectType SYS.XMLTYPE?


回答1:


As said in Ivan's comment, a solution is compile a cx_Oracle with libxml.a. As workaround, I used the solution proposed in the following page and read all the content as XML.

http://www.oracle.com/technetwork/articles/dsl/mastering-oracle-python-xml-1391344.html



来源:https://stackoverflow.com/questions/20904684/how-to-read-a-cx-oracle-object-with-type-cx-oracle-objecttype-sys-xmltype

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!