ODBC Data Sources on UNIX

On UNIX-like operating systems, the odbc.ini file contains a list of data sources.

When you create an .odbc.ini file, use the long form of each identifier, for example:
[My Data Source]
EngineName=myserver
CommLinks=tcpip(port=1870)
Userid=DBA
Password=sql

The preceding sample DSN shows only a subset of the valid connection parameters. Add network communication parameters as part of the CommLinks (LINKS) parameter.

You can create and manage ODBC data sources on UNIX using the iqdsn command-line utility.

ODBC Data Source File Location

References to ODBC functions are resolved at runtime.

To connect with ODBC data sources, the location of your .odbc.ini file must be referenced by one of the following variables. SAP Sybase IQ searches the directories specified by the variables below in the following order:

  1. $ODBCINI – must contain the exact full path name of the .odbc.ini file.

  2. $HOME

  3. Current directory

  4. $PATH

SAP Sybase IQ clients ignore the following variables when searching for  .odbc.ini:

  1. $ODBC_HOME

  2. $ODBC_INI

Use a text editor to edit .odbc.ini.

On UNIX-like operating systems, SAP Sybase IQ installs an ODBC driver and driver manager. The name of the driver file includes an operating system-specific extension, for example, so for Solaris systems. If you are using an ODBC application that uses libodbc.so (libodbc.so.1) or libodbcinst.so (libodbcinst.so.1), simply create symbolic links for these that point to $SYBASE/IQ-16_0/lib64/libdbodbc16.so.1. If you are creating a custom ODBC application, you can link directly to libdbodbc16.so.

If an ODBC driver manager is not present, the IQ ODBC driver (found via the symbolic link) uses the .odbc.ini for data source information.

ODBC Trace Output

To create an ODBC trace file, use the unixODBC driver manager.

Use the libdbodbc16.so driver and leave it up to the driver to choose the multithreaded or unthreaded driver. Tracing capability exists in the switch (libdbodbc16.so), not in the individual drivers (libdbodbc16_n.so or libdodbc16_r.so). If you change the driver to point to the _r version, you remove the switch from the call sequence, preventing the tracing.