[Zope-Checkins] CVS: Products/DCOracle2/DCOracle2 - DCOracle2.py:1.90

Matthew T. Kromer matt@zope.com
Wed, 5 Jun 2002 16:00:54 -0400


Update of /cvs-repository/Products/DCOracle2/DCOracle2
In directory cvs.zope.org:/tmp/cvs-serv31663/DCOracle2

Modified Files:
	DCOracle2.py 
Log Message:
Add better ROWID support


=== Products/DCOracle2/DCOracle2/DCOracle2.py 1.89 => 1.90 ===
         return apply(self._db.LobLocator,args)
 
+    # NONAPI
+    def rowid(self, *args):
+        """Allocate an empty rowid -- use for SP invocation"""
+        return apply(self._db.rowid, args)
+
     # API pass-through for internal cursor
     def __getattr__(self, name):
         d = self.__dict__
@@ -1010,6 +1015,9 @@
                 if t == dco2.OracleDateType:
                     size[c] = 7
                     mytype = 'SQLT_DAT'
+                elif t == dco2.OracleRowIDType:
+                    size[c] = 4 # FIXME dont know what size it is
+                    mytype = 'SQLT_RDD'
                 elif t == types.FloatType:
                     size[c] = 8
                     mytype = 'SQLT_FLT'
@@ -1382,8 +1390,10 @@
                     thisargValue = cursor._connection.LobLocator(dty)
                     a[0] = thisargValue
                     break   # Not a binding array, but a lob locator
-
-                if dty == 102:  # SQLT_CUR
+                elif dty == 11: # ROWID (old fmt)
+                    dty = 'SQLT_RDD'
+                    l = 4
+                elif dty == 102:  # SQLT_CUR
                     dty = 'SQLT_RSET'
                     l = 4   # Was 38 ?  harumph
                 elif dty == 2 and 'IN' not in thisargMode: 
@@ -1406,6 +1416,11 @@
                             # It probably wasnt a cursor going in -- make one
                             olda = cursor._connection.cursor()
                         ba[0] = TypeCoercion(olda, dty)
+                elif dty == 'SQLT_RDD':
+                    # dco2 will puke if you pass a non-ROWID in as a RDD
+                    if not 'IN' in thisargMode:
+                        # Take a rowid vs a binding array
+                        a[0] = cursor._connection.rowid()
                 elif 'IN' in thisargMode:    # This is an in/out parameter
                     ba[0] = olda      # FIXME doesnt do the array case
                     ba = self._argconvertIn(ba, argconvert, i)