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:
$ODBCINI – must contain the exact full path name of the .odbc.ini file.
$HOME
current directory
$PATH
Sybase IQ clients ignore the following environment variables when searching for .odbc.ini:
$ODBC_HOME
$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:
[an_entry_name]
Driver — the driver path
Userid — the user ID
Password — the password
EngineName — the desired engine
CommLinks — tcpip(port=engine_port_number)
AutoStop — no (Required parameter - must be set to no)
DatabaseName — the database name
DatabaseFile — the desired database with path. Used with embedded databases.
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.
For 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"