Integrating the SAP DB ODBC Driver
Use
You can use the SAP DB ODBC driver under UNIX/Linux both with and without a Driver Manager.
By entering link commands, you connect the static library
libsqlod.a or the dynamic library libsqlod.so with the application. Ensure with dynamic links that the dynamic library libsqlod.so is found by the system at execution time (see, for example, Idconfig, LD_LIBRARY_PATH).Procedure
Use with a Driver Manager
Using a Driver Manager, such as iODBC or unixODBC simplifies the exchange of ODBC drivers and allows the concurrent use of different ODBC drivers. The relevant documentation describes how you integrate an ODBC driver into the Driver Manager.
Use without a Driver Manager
If you are not using a Driver Manager, you must use an editor to enter the data for the SAP DB ODBC driver manually, either in the file ~/.
odbc.ini or the file /var/spool/sql/ini/odbc.ini.Result
The system first uses the valid
.odbc.ini file for the respective user from his or her home directory during the assignment of data sources. If no suitable data source is found there, the system evaluates the file /var/spool/sql/ini/odbc.ini.Using the ODBC Driver without a Driver Manager
Compiler command:
Compile the ODBC application
cc –c myapp.c –I<ODBC_include>
Link command for static library:
Static linking of the application myapp
cc –o myapp myapp.o <ODBC_lib>/libsqlod.a
Link command for dynamic library:
Dynamic linking of the application
myappcc –o myapp myapp.o –L<ODBC_lib> -lsqlod