The ODBC CLI includes two include files for compiling applications:
These files can be found at $II_SYSTEM/ingres/files.
Other standard ODBC includes libraries, such as sqlucode.h or sqltypes.h, are already included within the ODBC CLI version of sql.h and sqlext.h.
Windows: On Windows, the library is named INGODBC.DLL and resides in %II_SYSTEM%\ingres\lib.
UNIX: On UNIX and Linux, the ODBC CLI is installed as the shared library libiiodbc.[ext]. Depending on the UNIX or Linux implementation, the library extension ([ext]) varies. The library resides in $II_SYSTEM/ingres/lib.
VMS: On VMS, the library is named IIODBC.EXE and resides in I_SYSTEM:[INGRES.LIBRARY].
ODBC CLI applications link against the appropriate shared library.
ODBC applications can be coded using the ODBC Command Line Interface exactly as if coded with the Microsoft ODBC Driver Manager library or unixODBC Driver Manager library.
Here is an example for building an ODBC CLI application on Linux:
cc -c myOdbcApp.c /I$II_SYSTEM/ingres/files
ld -o myOdbcApp myOdbcApp.o -L$II_SYSTEM/ingres/lib -liiodbc.1
Before using the ODBC CLI, the utility iisuodbc must be executed. Iisuodbc configures Ingres with the appropriate name of the ODBC driver library and creates the ODBC configuration file, odbcinst.ini. For more information, see Configure a Data Source (Windows) and Configure a Data Source (UNIX and VMS).
The use of odbcinst.ini, odbc.ini or the ODBC configuration registry is optional for the ODBC CLI. An application can use invoke SQLConnect() by using a connection string that omits an ODBC Data Source (DSN) specification.
If the connection string has sufficient information to connect to the database, the location and name of the ODBC driver library are automatically determined. The use of the iiodbcadmn utility (UNIX, Linux, and VMS) or Microsoft ODBC Administrator (Windows) is optional.