error linking libverticaodbc.dylib / InvalidOperation: Inval

Moderator: NorbertKrupa

Post Reply
kesten
Newbie
Newbie
Posts: 3
Joined: Thu Jan 24, 2013 9:58 pm

error linking libverticaodbc.dylib / InvalidOperation: Inval

Post by kesten » Tue May 13, 2014 2:50 pm

I have a licensed copy of vertica 6.1.2
I can access centos-hosted tables from my macbook (osx maverics) using vsql and DbVisualizer just fine.
I am using unixodbc (2.3.2) instead of the default iODBC which i was unable to get working.
I am using pyodbc 3.0.7

I wish to use pyodbc to connect to vertica from my mac.
I ran into numerous problems encountered on these forums.

https://community.vertica.com/vertica/t ... dbc_on_mac
https://community.vertica.com/vertica/t ... ding_issue

By following the instructions at the bottom of the second link, i was able to recompile pyodbc
python setup.py install
using unixodbc and the change for SQL_WCHAR

This took me from output like this

[(u'\U00103030\udc8d\udc35\uddcc\ude2d\udc8b\udd32\U000d6463\udd8d\ude30\udcd8\ude34\udc59\udc33\udd0d\udd30', u'\udc4d\udf37\udc4d\ude38', u'\U00056565\udc4e\udc39\U0005312d\udc8b\udd30\U000d3635\U00013465\U00033233\ude18\udd64\udc98\udd39', u'\U000f5246\U00022054'),

To correctly reading string variables.

However, when it comes to reading Numeric values from a table, I get
/Users/kbroughton/anaconda/python.app/Contents/lib/python2.7/decimal.pyc in _raise_error(self, condition, explanation, *args)
3870 # Errors should only be risked on copies of the context
3871 # self._ignored_flags = []
-> 3872 raise error(explanation)
3873
3874 def _ignore_all_flags(self):

InvalidOperation: Invalid literal for Decimal: u''

I've traced it to a call in getdata.cpp
static PyObject* GetDataDecimal(Cursor* cur, Py_ssize_t iCol)

If anyone has a fix for this, I can stop here.

At that point, i decided I needed to do some c++ debugging so I spend a day building a clang++ project culminating in the following
clang++ -g -o test_sqlwchar test_sqlwchar.cpp -I/Users/kbroughton/vcp/git/pyodbc/src/ -I/usr/local/Frameworks/Python.framework/Versions/2.7/include/python2.7/ -I/opt/vertica/include /usr/local/lib/libodbc.dylib /usr/local/lib/libodbcinst.dylib /opt/vertica/lib/libverticaodbc.dylib /usr/lib/libstdc++.dylib

Which does compile and link, but fails to run with the error
./test_sqlwchar
dyld: Library not loaded: ../Bin/Darwin_x8664/libVerticaODBC.dylib
Referenced from: /Users/kbroughton/vcp/git/pyodbc/./test_sqlwchar
Reason: image not found
Trace/BPT trap: 5

Here's the thing.. if i grep libVerticaODBC in the project or /opt/vertica or /usr/local/Cellar/unixodbc i get nothing. My odbc.ini and related files all use the correct
path to libverticaodbc.dylib as in the clang++ commandline above.
My hunch is that the capitalization is throwing things off, but I can't discover where that is coming from. I presume it corresponds to the camel case class name, but
can't figure out what is asking for the lib by the camelcase name.

If anyone has got pyodbc working on maverics, please share your secret sauce.

kesten

Post Reply

Return to “ODBC”