If it won't be simple, it simply won't be. [Hire me, source code] by Miki Tebeka, CEO, 353Solutions

Wednesday, September 18, 2013

Adding ODBC Source on OSX

At work, we're using Netezza as our main data warehouse. It took me a while to figure out how to add the ODBC driver on OSX so that I'll be able to connect with pyodbc.

Here are the steps:
  • Get the OSX Netezza ODBC driver and unpack it
    • Not sure where do get it, we have it internally
  • Extract the archive somewhere (say /opt/NetezzaODBCDriver)
  •  Add  export DYLD_LIBRARY_PATH="${DYLD_LIBRARY_PATH}":/opt/NetezzaODBCDriver/lib/ to your ~/.zshrc (or ~/.bashrc)
  • mkdir -p ~/Library/ODBC
  • cp /opt/NetezzaODBCDriver/ini/*.ini ~/Library/ODBC
  • Edit ~/Library/ODBC/odbcinst.ini to reflect were your driver is (Driver and Setup keys)
    • In our example it'll be Driver = /opt/NetezzaODBCDriver/lib/libnzodbc.so (same for Setup) 
That's it, you can now connect to Netezza from OSX.

Here's a small example usage:

No comments:

Blog Archive