Exemplo n.º 1
0
 def get_returned_parameters(self):
     """with some providers, returned parameters and the .return_value are not available until
     after the last recordset has been read.  In that case, you must coll nextset() until it
     returns None, then call this method to get your returned information."""
     
     retLst=[]  # store procedures may return altered parameters, including an added "return value" item
     for p in tuple(self.cmd.Parameters):
         if verbose > 2:
             print('Returned=Name: %s, Dir.: %s, Type: %s, Size: %s, Value: "%s",' \
                   " Precision: %s, NumericScale: %s" % \
                     (p.Name, adc.directions[p.Direction],
                      adc.adTypeNames.get(p.Type, str(p.Type)+' (unknown type)'),
                      p.Size, p.Value, p.Precision, p.NumericScale))
         pyObject = api.convert_to_python(p.Value, api.variantConversions[p.Type])
         if p.Direction == adc.adParamReturnValue:
             self.returnValue = pyObject  # also load the undocumented attribute (Vernon's Error!)
             self.return_value = pyObject
         else:
             retLst.append(pyObject)
     return retLst   # return the parameter list to the caller
Exemplo n.º 2
0
    def get_returned_parameters(self):
        """with some providers, returned parameters and the .return_value are not available until
        after the last recordset has been read.  In that case, you must coll nextset() until it
        returns None, then call this method to get your returned information."""

        retLst = [
        ]  # store procedures may return altered parameters, including an added "return value" item
        for p in tuple(self.cmd.Parameters):
            if verbose > 2:
                print 'Returned=Name: %s, Dir.: %s, Type: %s, Size: %s, Value: "%s",' \
                      " Precision: %s, NumericScale: %s" % \
                        (p.Name, adc.directions[p.Direction],
                         adc.adTypeNames.get(p.Type, str(p.Type)+' (unknown type)'),
                         p.Size, p.Value, p.Precision, p.NumericScale)
            pyObject = api.convert_to_python(p.Value,
                                             api.variantConversions[p.Type])
            if p.Direction == adc.adParamReturnValue:
                self.returnValue = pyObject  # also load the undocumented attribute (Vernon's Error!)
                self.return_value = pyObject
            else:
                retLst.append(pyObject)
        return retLst  # return the parameter list to the caller