on 2013 Sep 17 8:57 PM
Is there any documentation on the configuration of the SAP/Sybase ODBC Manager under Linux, the only documentation I found says it exists and the install places entries in the {home}/.odbc.ini file? Is there an odbcinst.ini file somewhere and/or an odbc.ini for system wide instead of user based entries? What does one need to tell other non-SAP/Sybase applications that the system is using the SAP/Sybase ODBC manager (like wine for example)?
Another alternative -- The documentation says that unixODBC >= 2.2.14 can be used as the ODBC manager. Does anyone know how SAP/ Sybase applications are told unixODBC and not the default SAP/Sybase is the ODBC manager for this system? (What is the recommended contents of odbcint.ini for SQL Anywhere 16, if not identified above?)
Does anyone know how SAP/ Sybase applications are told unixODBC and not the default SAP/Sybase is the ODBC manager for this system?
Let's start with general ODBC linking on Linux:
When you compile/link your generic ODBC program on Linux, you will typically specify -lodbc
to link to the generic ODBC libraries - this then tells the linker (ld
) to include whichever libodbc.so
from the LD_LIBRARY_PATH
environment variable that appears first, at run time when your program is run. A unixODBC installation includes libodbc.so
, which triggers the loading of the actual unixODBC driver manager and related drivers / sources from the unixODBC installation (libodbcinst.so
, etc.). The unixODBC libodbcinst.so
then does the actual reading of ODBCHOME
, HOME
, ODBC_INI
, etc. to find its information (Reading .odbc.ini
, etc.).
( Sidenote: if you didn't want to use unixODBC as a driver manager, and instead picked yet another third-party ODBC driver manager like iODBC, whichever libodbc.so
appears first in LD_LIBRARY_PATH
will be the ODBC driver manager used for your program. )
What does one need to tell other non-SAP/Sybase applications that the system is using the SAP/Sybase ODBC manager (like wine for example)?
The SQL Anywhere ODBC Driver for Unix is the shared library libdbodm16.so
(found in /lib32
or /lib64
), so in order to reference this library as the primary ODBC driver manager, linking to -ldbodm16
at compile/link time would specify this for your program. If you (or your third-party program) already have linked against -lodbc
, then you would need to create a symbolic link from libodbc.so
to our driver manager file:
ln -s $SQLANY16/lib64/libodbc.so $SQLANY16/lib64/libdbodm16.so
and ensure that the lib64
(or lib32
) path then appears first in LD_LIBARY_PATH
when you load your program (which would happen if you always source the sa_config.(c)sh script, for instance).
You could also link directly against our ODBC driver file by specifying -ldbodbc16
in your linker options, skip the driver manager, and just provide the connection string information in a SQLDriverConnect
call.
I could never get this to work with wine and adopted another approach.
According to the unixODBC page regarding the topic of interfacing with Wine, Wine is linking against a natively running ODBC.DLL
, which should be linked against -lodbc
in the Linux environment, as most ODBC programs are usually linked. I would guess that the environment variable LIB_ODBC_DRIVER_MANAGER
should point to a location with a linkable libodbc.so
shared object - if you create the libodbc.so
symbolic link as I mentioned above and then provide the path to $SQLANY16/lib64
to LIB_ODBC_DRIVER_MANAGER
, Wine should be able to call out to our driver manager (although actual compatibility of the ODBC programs involved may still be incompatible - you would need to test this configuration).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
71 | |
11 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.