Using ODBC data sources on UNIX

On UNIX operating systems, ODBC data sources are held in a file named .odbc.ini. When creating a .odbc.ini file on any UNIX system, you must use the long form of each identifier, for example:

[My Data Source]
EngineName=myserver
CommLinks=tcpip(port=1870)
Userid=DBA
Password=SQL

You can enter any connection parameter in the .odbc.ini file. Network communications 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. For more information see “Creating an ODBC data source from the command line”.

File location

References to ODBC functions are resolved at run time. The client looks for the .odbc.ini file in the paths specified by the following variables (in order):

  1. ODBCINI environment

  2. ODBCHOME

NoteOn UNIX systems, Sybase IQ installs only the ODBC driver, and not the driver manager. The name of the driver file includes an operating system-specific extension, for example, so for Solaris systems. For example, on a Sun Solaris system, 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/ASIQ-12_7/lib/libdbodbc9.so.1. If you are creating a custom ODBC application, you can link directly to dbodbc9.so.

If Sybase IQ does not detect the presence of an ODBC driver manager, it will use ~/.odbc.ini for data source information. Otherwise, it will query the driver manager for data source information.

See Chapter 7, “ODBC Programming” in the Adaptive Server Anywhere Programming Guide to ensure that you are using the correct driver for your platform.