title: pyodbc database connection and number format
body: <p>I'm connecting a Python algorithm to an Oracle database using pypyodbc library.</p>
  
  <p>I'm using the following:</p>
  
  <pre><code>def connectToServer(DSN,Server,Password):
      connString = "DSN="+DSN+";Uid="+Server+";Pwd="+Password
      connObject = odbc.connect(connString)
  
      return connObject
  
  connObject = connectToServer('xxx','xxx','xxx')
  </code></pre>
  
  <p>Connection works well, i can pass commands to the server (create, drop tables, execute procedure etc...)</p>
  
  <p>However i cannot extract data via the following:</p>
  
  <pre><code># print top lines of a given table
  def selectTopFromTable(connObject,tableName,numberRow=100):
      cur = connObject.cursor()
      command = '''SELECT * FROM ''' + tableName +''' WHERE ROWNUM &lt;= ''' + str(numberRow) + '''; '''  
      cur.execute(command)
  
      for row in cur.fetchall():
          print(row)
  
  selectTopFromTable(connObject,'xxx')
  </code></pre>
  
  <p>Getting the following error:</p>
  
  <blockquote>
    <p>ValueError: could not convert string to float: b'5,3'</p>
  </blockquote>
  
  <p>I think the issue lies in the format number FR versus EN (i'm working on a FR based server) - the server provides values in FR format number (i.e. 5,3 instead of 5.3) and Python is confused when trying to convert a supposedly NUMBER SQL type into a double.</p>
  
  <p>Is it possible to configure the pypyodbc connection to retrieve value in EN number format? (the same way a client such as SQL Developer or Toad is set up to do so)?</p>