Skip to content

Commit

Permalink
Update ODPI-C to support fetching XMLType as strings
Browse files Browse the repository at this point in the history
(#14).
  • Loading branch information
anthony-tuininga committed Dec 3, 2018
1 parent ef036cb commit 4c12b47
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion odpi
13 changes: 13 additions & 0 deletions test/Cursor.py
Original file line number Diff line number Diff line change
Expand Up @@ -626,3 +626,16 @@ def testVarTypeWithObjectType(self):
self.assertEqual(result,
"udt_Object(28, 'Bind obj out', null, null, null, null, null)")

def testFetchXMLType(self):
"test that fetching an XMLType returns a string contains its contents"
intVal = 5
label = "IntCol"
expectedResult = "<%s>%s</%s>" % (label, intVal, label)
self.cursor.execute("""
select XMLElement("%s", IntCol)
from TestStrings
where IntCol = :intVal""" % label,
intVal = intVal)
result, = self.cursor.fetchone()
self.assertEqual(result, expectedResult)

0 comments on commit 4c12b47

Please sign in to comment.