title: Python pyodbc connections to IBM Netezza Erroring
body: <p>So. This issue is almost exactly the same as the one discussed <a href="https://stackoverflow.com/questions/14270745/issue-with-querying-teradata-in-python-pyodbc">here</a> -- but the fix (such as it is) discussed in that post doesn't fix things for me. </p>
  
  <p>I'm trying to use Python 2.7.5 and pyodbc 3.0.7 to connect from an Ubuntu 12.04 64bit machine to an IBM Netezza Database. I'm using unixODBC to handle specifying a DSN. This DSN works beautifully from the <code>isql</code> CLI -- so I know it's configured correctly, and unixODBC is ticking right along. </p>
  
  <p>The code is currently dead simple, and easy to reproduce in a REPL:</p>
  
  <pre><code>In [1]: import pyodbc
  In [2]: conn = pyodbc.connect(dsn='NZSQL')
  In [3]: curs = conn.cursor()
  In [4]: curs.execute("SELECT * FROM DB..FOO ORDER BY created_on DESC LIMIT 10")
  Out[4]: &lt;pyodbc.Cursor at 0x1a70ab0&gt;
  
  In [5]: curs.fetchall()
  ---------------------------------------------------------------------------
  InvalidOperation                          Traceback (most recent call last)
  &lt;ipython-input-5-ad813e4432e9&gt; in &lt;module&gt;()
  ----&gt; 1 curs.fetchall()
  
  /usr/lib/python2.7/decimal.pyc in __new__(cls, value, context)
      546                     context = getcontext()
      547                 return context._raise_error(ConversionSyntax,
  --&gt; 548                                 "Invalid literal for Decimal: %r" % value)
      549
      550             if m.group('sign') == "-":
  
  /usr/lib/python2.7/decimal.pyc in _raise_error(self, condition, explanation, *args)
     3864         # Errors should only be risked on copies of the context
     3865         # self._ignored_flags = []
  -&gt; 3866         raise error(explanation)
     3867
     3868     def _ignore_all_flags(self):
  
  InvalidOperation: Invalid literal for Decimal: u''
  </code></pre>
  
  <p>So I get a connection, the query returns correctly, and then when I try to get a row... asplode. </p>
  
  <p>Anybody ever managed to do this?</p>