本文介绍了如何读取类型为cx_Oracle.ObjectType SYS.XMLTYPE的cx_Oracle.OBJECT?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用cx_Oracle从Oracle读取XMLType
列的内容,但是我不明白.
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>
如何读取类型为cx_Oracle.ObjectType SYS.XMLTYPE
的cx_Oracle.OBJECT
的内容?
How can I read the content of a cx_Oracle.OBJECT
with type cx_Oracle.ObjectType SYS.XMLTYPE
?
推荐答案
如Ivan的评论所述,一种解决方案是使用libxml.a
编译cx_Oracle.解决方法是,我使用下一页中提出的解决方案,并将所有内容读取为XML.
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
这篇关于如何读取类型为cx_Oracle.ObjectType SYS.XMLTYPE的cx_Oracle.OBJECT?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!