parameters: (p, value, adotype, settings_known)
docstring: Configure the given ADO Parameter 'p' with the Python 'value'.
docstring_summary: Configure the given ADO Parameter 'p' with the Python 'value'.
docstring_tokens: Configure the given ADO Parameter p with the Python value .
function: def _configure_parameter(p, value, adotype, settings_known):
      """Configure the given ADO Parameter 'p' with the Python 'value'."""
  
      if adotype in api.adoBinaryTypes:
          p.Size = len(value)
          p.AppendChunk(value)
  
      elif isinstance(value, StringTypes):  # v2.1 Jevon
          L = len(value)
          if adotype in api.adoStringTypes:  # v2.2.1 Cole
              if settings_known:
                  L = min(L, p.Size)  # v2.1 Cole limit data to defined size
              p.Value = value[:L]  # v2.1 Jevon & v2.1 Cole
          else:
              p.Value = value  # dont limit if db column is numeric
          if L > 0:  # v2.1 Cole something does not like p.Size as Zero
              p.Size = L  # v2.1 Jevon
  
      elif isinstance(value, decimal.Decimal):
          if api.onIronPython:
              s = str(value)
              p.Value = s
              p.Size = len(s)
          else:
              p.Value = value
          exponent = value.as_tuple()[2]
          digit_count = len(value.as_tuple()[1])
          p.Precision = digit_count
          if exponent == 0:
              p.NumericScale = 0
          elif exponent < 0:
              p.NumericScale = -exponent
              if p.Precision < p.NumericScale:
                  p.Precision = p.NumericScale
          else:  # exponent > 0:
              p.NumericScale = 0
              p.Precision = digit_count + exponent
  
      elif type(value) in dateconverter.types:
          if settings_known and adotype in api.adoDateTimeTypes:
              p.Value = dateconverter.COMDate(value)
          else:  # probably a string
              # provide the date as a string in the format 'YYYY-MM-dd'
              s = dateconverter.DateObjectToIsoFormatString(value)
              p.Value = s
              p.Size = len(s)
  
      elif api.onIronPython and isinstance(value, longType):  # Iron Python Long
          s = str(value)  # feature workaround for IPy 2.0
          p.Value = s
  
      elif adotype == adc.adEmpty:  # ADO will not let you specify a null column
          p.Type = (
              adc.adInteger
          )  # so we will fake it to be an integer (just to have something)
          p.Value = None  # and pass in a Null *value*
  
          # For any other type, set the value and let pythoncom do the right thing.
      else:
          p.Value = value
function_tokens: def _configure_parameter ( p , value , adotype , settings_known ) : if adotype in api . adoBinaryTypes : p . Size = len ( value ) p . AppendChunk ( value ) elif isinstance ( value , StringTypes ) : # v2.1 Jevon L = len ( value ) if adotype in api . adoStringTypes : # v2.2.1 Cole if settings_known : L = min ( L , p . Size ) # v2.1 Cole limit data to defined size p . Value = value [ : L ] # v2.1 Jevon & v2.1 Cole else : p . Value = value # dont limit if db column is numeric if L > 0 : # v2.1 Cole something does not like p.Size as Zero p . Size = L # v2.1 Jevon elif isinstance ( value , decimal . Decimal ) : if api . onIronPython : s = str ( value ) p . Value = s p . Size = len ( s ) else : p . Value = value exponent = value . as_tuple ( ) [ 2 ] digit_count = len ( value . as_tuple ( ) [ 1 ] ) p . Precision = digit_count if exponent == 0 : p . NumericScale = 0 elif exponent < 0 : p . NumericScale = - exponent if p . Precision < p . NumericScale : p . Precision = p . NumericScale else : # exponent > 0: p . NumericScale = 0 p . Precision = digit_count + exponent elif type ( value ) in dateconverter . types : if settings_known and adotype in api . adoDateTimeTypes : p . Value = dateconverter . COMDate ( value ) else : # probably a string # provide the date as a string in the format 'YYYY-MM-dd' s = dateconverter . DateObjectToIsoFormatString ( value ) p . Value = s p . Size = len ( s ) elif api . onIronPython and isinstance ( value , longType ) : # Iron Python Long s = str ( value ) # feature workaround for IPy 2.0 p . Value = s elif adotype == adc . adEmpty : # ADO will not let you specify a null column p . Type = ( adc . adInteger ) # so we will fake it to be an integer (just to have something) p . Value = None # and pass in a Null *value* # For any other type, set the value and let pythoncom do the right thing. else : p . Value = value