Question

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?

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top