in reply to Re: Problems with DBD::ODBC and DBD::Sybase
in thread Problems with DBD::ODBC and DBD::Sybase

Okay, I read the background info you posted. Thanks, that made it a lot clearer. Then I ran the command you suggested to find odbcinst.ini. It worked, see:

rebecca-witmers-macbook-pro-15:jtds-1.2.2-dist rwitmer$ iodbc-config --odbcinstini
/Library/ODBC/odbcinst.ini

The trouble is, when I go there, nothing is there. Really:

rebecca-witmers-macbook-pro-15:jtds-1.2.2-dist rwitmer$ cd /Library/ODBC/
-bash: cd: /Library/ODBC/: No such file or directory

So I tried doing a find on the entire hard drive. Lots of Permission denied messages on directories I"m assuming you have to sudo to search, but no odbcinst.ini. Doing a search in the Mac Finder GUI yields same results.

I did find this though:

rebecca-witmers-macbook-pro-15:Shared rwitmer$ find /usr/bin /bin /usr/sbin /sbin /usr/local/bin /usr/X11/bin -name iodbc-config
/usr/bin/iodbc-config

And this:

rebecca-witmers-macbook-pro-15:Shared rwitmer$ ls /usr/bin/ | grep odbc
iodbc-config
iodbctest
iodbctestw

And this:

rebecca-witmers-macbook-pro-15:include rwitmer$ ls /Developer/SDKs/MacOSX10.4u.sdk/usr/include | grep iodbcinst
iodbcinst.h

But that's in the directory for OSX 10.4. My machine has 10.5. What's the deal here? Do I have this driver manager thing or what? I am confused.

  • Comment on Re^2: Problems with DBD::ODBC and DBD::Sybase

Replies are listed 'Best First'.
Re^3: Problems with DBD::ODBC and DBD::Sybase
by mje (Curate) on May 29, 2009 at 07:56 UTC

    I see you have also posted to the FreeTDS list - that is a good idea. The fact that you can run iodbc-config shows you do have the iODBC driver manager installed. The --odbcinstini argument is telling you which file to add your drivers to. If the file does not exist, create it. Similarly with the odbc.ini file.

    iodbctest is the command line app you can use to test your dsns are working. iodbctestw is a unicode aware version of the same app.

    You need to go ahead and create your odbcinst.ini and odbc.ini files based on my previous comments and the help on the freetds web site detailing what to put in them. But bare in mind the freetds site instructions are probably for the unixODBC driver manager and iODBC (the driver manager you are using) is slightly different in the way you name driver and data sources - see my previous reply.

    I'm no expert OSX person but if you get no joy from the freetds list I might be able to help further.

      Okay, here's the answer:

      Like the previous commenter said, to get Sybase to install you have to read the suggestion here:

      http://www.mail-archive.com/dbi-users@perl.org/msg31071.html

      Those symbols are missing from the FreeTDS include files.

      Edit dbdimp.c, and somewhere near the top add:

      #define BLK_VERSION_150 BLK_VERSION_100 #define BLK_VERSION_125 BLK_VERSION_100 #define BLK_VERSION_120 BLK_VERSION_100

      Then recompile.

      Also, do not try testing using the scripts here: http://www.freetds.org/userguide/perl.htm#DBD.SYBASE

      Because there is no Sybase public server since about 10 years ago, apparently. Definitely not now.

      Also, you have to remember that if something freezes up and you get irritated and shut down your machine, when you turn it back on you have to reset your SYBASE environment variable or it will not find the driver that freetds comes with. Doh.

      Thanks for all your help! I definitely understand the way it works much better now that I looked at it really closely at the least.