10. Understanding ODBC Connectivity : ODBC Driver Requirements : ODBC Driver Manager Programs : UnixODBC Implementation Considerations
 
Share this page                  
UnixODBC Implementation Considerations
The ODBC Driver can be used with the unixODBC Driver Manager on non-Windows platforms. Unlike the ODBC CLI, the unixODBC Driver Manager allows other ODBC drivers to be used in addition to the Ingres/Vector ODBC driver. To build the application, the include files sql.h and sqlext.h files in $II_SYSTEM/ingres/files can be used; alternatively, the include files sql.h, sqlext.h, sqltypes.h, and sqlucode.h provided with the unixODBC installation can be used.
UnixODBC data sources can be configured using the Ingres ODBC Administrator, just as for the ODBC CLI. Unlike the CLI, the ODBCINI and ODBCSYSINI environment variables must be specified if the locations for the odbc.ini and odbcinst.ini files differ from the default locations. For more information about ODBCINI and ODBCSYSINI in the unixODBC environment, see the unixODBC documentation.
Linux: Here is an example for building a unixODBC application on Linux:
cc -c myOdbcApp.c /I/disk1/unixODBC-2.2.12/include
ld -o myOdbcApp myOdbcApp.o -L/disk1/unixODBC-2.2.12/DriverManager -lodbc
VMS: Here is an example for building a unixODBC application on VMS:
$ cc/nowarn/name=as_is/nodeb/float=ieee/opt/include=DKA0:[TESTENV.UNIXODBC-2.2.3.INCLUDE]-
 odbctest.c
$ lin/nodeb/exe=odbctest_unixodbc.exe odbctest.obj, sys$input/opt
CASE_SENSITIVE=YES
sys$share:ODBC.EXE/share
SYS$LIBRARY:PTHREAD$RTL.EXE/SHARE
Note:   
The “as_is” qualifier is required for compiling and the “CASE_SENSITIVE=YES” qualifier is used for unixODBC. This means that the ODBC function entry points are case-sensitive, which is the default for unixODBC on VMS.
For successful loading of the Ingres/Vector ODBC Driver, SYS$LIBRARY:PTHREAD$RTL.EXE must be included when the unixODBC image is linked. Multi-threading, however, is not currently supported for the ODBC Driver on VMS.