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

System Information File Location

SAP 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: SAP Sybase IQ clients ignore these environment variables when searching for the system information file:
  • $ODBC_HOME

  • $ODBC_INI

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.

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=$IQDIR16/demo/iqdemo.db"
This example is shown on multiple lines, however, you must enter the entire command at the command prompt on one line.

Additional Information

  • Utility Guide > iqdsn Database Administration Utility

Related concepts
ODBC Conformance
Installing ODBC Drivers
Using UNIX or Linux–Based Query Tools Through ODBC
Command Line Connections to 32-bit Applications