Storing connection information

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

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

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

For example:

[sample_dsn]
Driver=/s3/mysybase12.4.3/IQ-15_2/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 the Utility Guide.

NoteIn Sybase IQ version 12.5 and later, 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.

To connect without using .odbc.ini, you can enter an Interactive SQL command that specifies the entire entry. This example is shown on multiple lines, however, 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"