Correct handling of objects when dynamic binding is performed.

This commit is contained in:
Anthony Tuininga 2017-08-24 21:53:49 -06:00
parent c2c8d541bf
commit 7a8498ee5f
3 changed files with 18 additions and 1 deletions

1
.gitmodules vendored
View File

@ -1,3 +1,4 @@
[submodule "odpi"]
path = odpi
url = https://github.com/oracle/odpi.git
branch = v2.0.x

2
odpi

@ -1 +1 @@
Subproject commit dfa763c343a64e85c60bda1cae93af35e9967b9d
Subproject commit a9f97d54e6529b39eac3322c9cb58e8a78b730b8

View File

@ -102,3 +102,19 @@ class TestDMLReturning(BaseTestCase):
"The final value of string 10"
])
def testInsertAndReturnObject(self):
"test inserting an object with DML returning"
typeObj = self.connection.gettype("UDT_OBJECT")
stringValue = "The string that will be verified"
obj = typeObj.newobject()
obj.STRINGVALUE = stringValue
outVar = self.cursor.var(cx_Oracle.OBJECT, typename = "UDT_OBJECT")
self.cursor.execute("""
insert into TestObjects (IntCol, ObjectCol)
values (4, :obj)
returning ObjectCol into :outObj""",
obj = obj, outObj = outVar)
result = outVar.getvalue()
self.assertEqual(result.STRINGVALUE, stringValue)
self.connection.rollback()