Easysoft Data Access

How can I avoid setting shell environment variables required by a driver?

Article:
00809
Last Reviewed:
3rd January 2024
Revision:
2

Some drivers require environment variables setting before you can successfully connect (e.g. DB2 and DB2INSTANCE, Oracle and ORACLE_HOME). If you are using the unixODBC Driver Manager you can set environment variables per DSN in the odbc.ini file using the following syntax:

DMEnvAttr = SQL_ATTR_UNIXODBC_ENVATTR={ENVVAR=value}

e.g.

DMEnvAttr = SQL_ATTR_UNIXODBC_ENVATTR={DB2INSTANCE=db2inst2}

The unixODBC driver manager will then set the environment variable before connecting to the driver. Note, this only works this way when using DSN based connections.

Applies To

Knowledge Base Feedback

* Did this content help you?
* Please select one option based on your first choice:

(* Required Fields)