File tree Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Original file line number Diff line number Diff line change 1
1
[submodule "odpi "]
2
2
path = odpi
3
3
url = https://github.com/oracle/odpi.git
4
+ branch = v2.0.x
Original file line number Diff line number Diff line change @@ -102,3 +102,19 @@ def testUpdateMultipleRows(self):
102
102
"The final value of string 10"
103
103
])
104
104
105
+ def testInsertAndReturnObject (self ):
106
+ "test inserting an object with DML returning"
107
+ typeObj = self .connection .gettype ("UDT_OBJECT" )
108
+ stringValue = "The string that will be verified"
109
+ obj = typeObj .newobject ()
110
+ obj .STRINGVALUE = stringValue
111
+ outVar = self .cursor .var (cx_Oracle .OBJECT , typename = "UDT_OBJECT" )
112
+ self .cursor .execute ("""
113
+ insert into TestObjects (IntCol, ObjectCol)
114
+ values (4, :obj)
115
+ returning ObjectCol into :outObj""" ,
116
+ obj = obj , outObj = outVar )
117
+ result = outVar .getvalue ()
118
+ self .assertEqual (result .STRINGVALUE , stringValue )
119
+ self .connection .rollback ()
120
+
You can’t perform that action at this time.
0 commit comments