Introduction Welcome to the combined release of OpenLink ODBC for Unix
and the free iODBC driver manager. This kit will provide you with everything you need in
order to develop ODBC compliant applications under UNIX.
Installation of Run-time Distribution Move the following files to an installation directory of your choice (If such a directory does not exist, please create one):
From within the OpenLink base installation directory run the "install.sh" script using the command:
This will automatically extract the contents of the .taz file into the following sub-directory structure within your OpenLink base installation directory.
The next step is to ensure that your host operating system's shared library PATH variable is set correctly so that the ODBC Driver Manager and OpenLink ODBC Driver shared libraries are locatable by your UNIX based ODBC Application. Under many UNIX flavors the environment variable
LD_LIBRARY_PATH is used to set the shared library PATH. Please note that older versions of
AIX use the environment variable LIBPATH, while HP-UX requires the environment variable
SHLIB_PATH.
Configuration of Run-time Distribution The iODBC driver manager links iODBC clients to iODBC
Drivers via the iODBC configuration file. This file is typically the file
"~/.odbc.ini" (where the tilde stands for the user's home directory. Your
OpenLink iODBC SDK installation process will place this file in the $HOME directory of the
account user installing the SDK. It will also set the correct references to the Driver
Manager and OpenLink ODBC Driver shared libraries. The example below depicts the structure of an iODBC DSN named "dsn_oracle7", used to facilitate connections with an Oracle Database residing on a machine named "mercury". [dsn_oracle7] [UDBC] Note: It is highly recommended that you use the iODBC DSN templates provided by your OpenLink ODBC SDK installation for your initial connection, the iODBC SDK installer program sets up the appropriate iODBC environment for you at installation time. The table below describes each OpenLink iODBC DSN attributes required for making a connection from your ODBC based application to your backend database engine.
Example ODBC Connect Strings: "" (Empty Connect String) This implies the use of values from the [Default] section of the iODBC configuration file. There must be at least a "Host=" definition in this section. "DSN=dsn_oracle7" Use the values from the [dsn_oracle7] section. "DSN=MyOracle7dsn;UID=scott;PWD=tiger" Use the values from the [dsn_oracle7] section, and overrides the value for UserName. Also use the password "tiger" to gain access to the database. "HOST=mercury;SVT=Oracle 7;DATABASE=ORCL;UID=scott/tiger" Connect to an Oracle 7 database on the machine "mercury" . "READONLY=Y" Make a read-only connection to the [Default] database. The Sample ODBC Application "ODBCTEST" Your OpenLink UDBC SDK installation contains a sample interactive dynamic SQL application called "odbctest", this application is situated within your OpenLink installation's "odbcsdk/examples" sub-directory. Then run the application by typing the following command from the command line prompt: odbctest The application will prompt you for a connect string (assuming we are using the UDSN example depicted above):
If you connect to the database successfully you will get a SQL prompt: SQL> Type a valid SQL statement and then press <return> to send your request to your UDSN SQL> select * from <table name> or Use an OpenLink quick table list command: SQL> tables If the query returns data and was successful, the data will be scrolled down the screen. Otherwise you will receive an error message. Type in "exit" to quit the application Further Reading: "Data Management: SQL Call Level Interface (CLI)" from X/Open in conjunction with SQL Access Group ISBN: 1-872630-63-4 X/Open Document Number: S203 Microsoft ODBC API documentation
|