Storing connection information

If you are running a UNIX client, an .odbc.ini file on your system stores the information used to access each database. (Note that the filename begins with a period.)

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:

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

You need to edit the .odbc.ini file with any text editor to add entries for your data sources.

NoteOn AIX platforms, you should 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.

Each entry in the .odbc.ini file should have the following format:

For example:

[sample_dsn]
Driver=/s3/mysybase12.4.3/IQ-15_1/lib/libdbodbc11.so.l
Userid=DBA
Password=sql
EngineName=test_server
CommLinks=tcpip(port=1870)
AutoStop=no
DatabaseName=iqdemo
DatabaseFile=iqdemo.db

Once you have created a data source entry, you can connect to your database, by entering the dbisql command at the command prompt and specifying the data source entry name in a connection string. Sybase IQ finds the rest of the connection information in the .odbc.ini file. For example:

% dbisql –c "dsn=sample_dsn"

For more information about dbisql and its options, see Sybase IQ Utility Guide.

NoteFor Sybase IQ Version 12.5 and higher, by default any database that is started from a connection string is 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. (This does not apply in the case of multiplex IQ databases, which are started with Sybase Central.)

If you want to connect without using .odbc.ini, you can enter an Interactive SQL command that specifies the entire entry, like the following. While it is shown here on multiple lines, you must enter the entire command at the command prompt on one line.

% dbisql –c "UID=DBA;PWD=sql;AutoStop=no;
    ENG=<engine name>;DBF=$IQDIR15/demo/iqdemo.db"