Community Wiki

Ingres UNIX ODBC

From Ingres Community Wiki

Jump to: navigation, search

The Ingres Unix ODBC drivers have always supported unixODBC http://www.unixodbc.org/, i.e. one can use the unixODBC manager and use it with Ingres. unixODBC is shipped pre-built on many Linux distributions but can easily be built on most Unix platforms.

The Open Source release of Ingres also ship something called CLI. CLI is a simply ODBC manager/library that is built specifically for Ingres. CLI is installed on non-Windows platforms at the same time as the odbc driver which allows ODBC applications to be deployed/ran without the need to manage or use unixODBC, even under VMS!

CLI is the easiest way to deploying an ODBC based application against Ingres. Use the iiodbcadmn tool to manage DSN definitions (or simply use a connection string that specifies the database name).

Quick unixODBC build how to

unixODBC is a simple configure && make process. Here is how to quickly build unixODBC with basic features to be used with Ingres:

./configure --enable-gui=no --enable-drivers=no --prefix=PATH_FOR_UNIXODBC

If building under HP-UX, it is a good idea to force the use of the HP compiler and not gcc. I.e. before issueing configure issue:

setenv CC cc ## csh example


Once configure has completed issue build command:

make

At this point check for errors, if everything went well install the binaries:

make install

At this point unixODBC is ready and Ingres needs to be configured.

If iisuodbc has not been run, run it now as the Ingres installation owner (probably "ingres").

This will then create the required ini files in `$II_SYSTEM/ingres/files/`, specifically:

           $II_SYSTEM/ingres/files/odbc.ini
           $II_SYSTEM/ingres/files/odbcinst.ini

Then set OS variable ODBCSYSINI to point at that location, i.e.:

setenv ODBCSYSINI $II_SYSTEM/ingres/files/files/

Again this is a csh example for sh, ksh, bash, etc.:

ODBCSYSINI=$II_SYSTEM/ingres/files/files/
export ODBCSYSINI

Edit the ini files to create a DSN. You may also want to enable select loops so that read-only system catalogs can be queried.

Add unixODBC bin and lib paths.


UnixODBC can be tested by using the unixODBC isql tool (different to the Ingres tool of the same name!):

/full/path/to/unixodbc/bin/isql dsn_name -v

NOTE: use the `-v` to ensure that a decent error is reported back

Issue `quit` to exit the UnixODBC isql monitor.

Personal tools