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, you must use the long form of each identifier, for example:
[My Data Source]
EngineName=myserver
CommLinks=tcpip(port=1870)
Userid=DBA
Password=sql

In addition to the connection parameters in the sample DSN above, you can include others in the .odbc.ini file as well. See Connection Parameters for information about all supported connection parameters. Network communication parameters are added as part of the CommLinks (LINKS) parameter. For a complete list of network parameters, see Network Communications Parameters.

You can create and manage ODBC data sources on UNIX using the iqdsn command-line utility. See Creating an ODBC Data Source from the Command Line.

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. 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

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, 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-15_3/lib/libdbodbc11.so.1. If you are creating a custom ODBC application, you can link directly to libdbodbc11.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 see SQL Anywhere 11.0.1 > SQL Anywhere Server - Programming > SQL Anywhere Data Access APIs > SQL Anywhere ODBC API > Building ODBC Applications > Using the SQL Anywhere ODBC driver manager on UNIX.

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

Related concepts
Ways to Avoid Shared Memory Conflicts
Connection Parameters
Checking Common Network Communications Problems
Related tasks
Creating an ODBC Data Source from the Command Line
Related reference
Network Communications Parameters