diff --git a/.gitmodules b/.gitmodules index 9e4b5b2..815219a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,4 @@ [submodule "odpi"] path = odpi url = https://github.com/oracle/odpi.git + branch = v2.0.x diff --git a/odpi b/odpi index dfa763c..a9f97d5 160000 --- a/odpi +++ b/odpi @@ -1 +1 @@ -Subproject commit dfa763c343a64e85c60bda1cae93af35e9967b9d +Subproject commit a9f97d54e6529b39eac3322c9cb58e8a78b730b8 diff --git a/test/DMLReturning.py b/test/DMLReturning.py index 5871eeb..c6920c1 100644 --- a/test/DMLReturning.py +++ b/test/DMLReturning.py @@ -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() +