Managing ODBC Data Sources

On UNIX-like operating systems, ODBC data sources are stored in a system information file. Although this file is named .odbc.ini by default, it can have any name.

A system information file can include any connection parameter. This sample DSN connects to the demo database:
[My Data Source]
Userid=DBA
Password=sql
EngineName=test_server
CommLinks=tcpip(port=1870)
AutoStop=no
DatabaseName=iqdemo
DatabaseFile=iqdemo.db

You can create and manage ODBC data sources with the iqdsn utility. See "Data Source Utility (iqdsn) in the Utility Guide.

System Information File Location

Sybase IQ searches the following locations, in order, for the system information file:
  1. The $ODBCINI environment variable

  2. The $HOME environment variable

  3. The user's Home directory
  4. The $PATH environment variable
Note: Sybase IQ clients ignore these environment variables when searching for the system information file:
  • $ODBC_HOME

  • $ODBC_INI

On AIX platforms, always use specific host/port/server connection arguments. The AIX broadcast mechanism in a subnetted environment cannot detect with the BROADCAST message that another server of the same name and port number is running even in the same subnet.

Connecting with a Data Source Entry

To use a data source entry to connect to your database, open a terminal, and use dbisql with the data source entry name in a connection string. For example:
% dbisql –c "dsn=sample_dsn"
Note: Any database started from a connection string is, by default, stopped when there are no more connections to it, and any database that is loaded from a connection string is unloaded as soon as there are no more connections to it when the Autostop connection parameter is set to yes. This does not apply to multiplex IQ databases started with Sybase Central.

Connecting without a Data Source Entry

To connect without using .odbc.ini, open a terminal, and use dbisql all connection parameters. For example:
% dbisql –c "UID=DBA;PWD=sql;AutoStop=no;
    ENG=<engine name>;DBF=$IQDIR15/demo/iqdemo.db"
This example is shown on multiple lines, however, you must enter the entire command at the command prompt on one line.
Related concepts
ODBC Conformance
Installing ODBC Drivers
Using UNIX or Linux–Based Query Tools Through ODBC
Related reference
Managing ODBC Data Sources