问题
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