Skip to content

Commit 4c12b47

Browse files
Update ODPI-C to support fetching XMLType as strings
(oracle#14).
1 parent ef036cb commit 4c12b47

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

odpi

test/Cursor.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -626,3 +626,16 @@ def testVarTypeWithObjectType(self):
626626
self.assertEqual(result,
627627
"udt_Object(28, 'Bind obj out', null, null, null, null, null)")
628628

629+
def testFetchXMLType(self):
630+
"test that fetching an XMLType returns a string contains its contents"
631+
intVal = 5
632+
label = "IntCol"
633+
expectedResult = "<%s>%s</%s>" % (label, intVal, label)
634+
self.cursor.execute("""
635+
select XMLElement("%s", IntCol)
636+
from TestStrings
637+
where IntCol = :intVal""" % label,
638+
intVal = intVal)
639+
result, = self.cursor.fetchone()
640+
self.assertEqual(result, expectedResult)
641+

0 commit comments

Comments
 (0)