Correct handling of objects when dynamic binding is performed.
This commit is contained in:
parent
c2c8d541bf
commit
7a8498ee5f
1
.gitmodules
vendored
1
.gitmodules
vendored
@ -1,3 +1,4 @@
|
||||
[submodule "odpi"]
|
||||
path = odpi
|
||||
url = https://github.com/oracle/odpi.git
|
||||
branch = v2.0.x
|
||||
|
||||
2
odpi
2
odpi
@ -1 +1 @@
|
||||
Subproject commit dfa763c343a64e85c60bda1cae93af35e9967b9d
|
||||
Subproject commit a9f97d54e6529b39eac3322c9cb58e8a78b730b8
|
||||
@ -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()
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user