Using Yum to Install or Update the IBM i ODBC Driver

ODBC with Db2 for IBM iThe IBM i ODBC driver for Db2 has become easier to install.

Formerly available only as a download requiring several steps, the driver can now be installed and updated on IBM i with Yum or Access Client Solutions (ACS), as easily as with other IBM i open source packages.

Here are instructions for installing the ODBC driver using Yum.

Before you begin

A few prerequisites must be set up before you install the ODBC driver using Yum.

Update certificates, Yum to get new repository

The ODBC driver comes from a new repository named ibmi-release. A one-time update to ca-certificates-mozilla and yum will make this repository available to ACS and Yum.

To update these two packages from a terminal such as SSH or CALL QP2TERM, run this command:

yum update ca-certificates-mozilla yum

or update them individually via ACS Open Source Package Management’s “Updates available” tab:

Yum in Access Client Solutions (ACS)

Yum shown in ACS Installed Packages

Now install or update the ODBC driver

After the updates to ca-certificates-mozilla and yum, the ODBC driver will be available under the name ibm-iaccess.

To install from a terminal, run this command:

yum install ibm-iaccess

To update:

yum update ibm-iaccess

or use ACS. Once installed, the ibm-iaccess package will become visible in the ACS “Installed Packages” window:

ODBC Driver in Access Client Solutions (ACS)

ODBC driver application listed as ibm-iaccess in Installed Packages of ACS

Confirm that ODBC is installed and working

Test your ODBC installation by running the isql command, included with the open source components unixODBC and unixODBC-devel. Make sure these two components are installed using ACS or by running the following command, as before:

yum install unixODBC unixODBC-devel

Now you can test ODBC.

Connect to your IBM i database with the isql command:

/QOpenSys/pkgs/bin/isql -v *LOCAL

You should see a “Connected!” message followed by an SQL prompt:

Type this SQL statement and see the query results below it:

select * from qiws.qcustcdt

Now exit the isql environment using the quit command:

SQL> quit

Your ODBC installation or upgrade is complete

Use this method to update your ODBC driver as IBM releases new versions, or for hassle-free installation on new IBM i systems. Ever since IBM made ODBC available on their new repository, we have used the Yum installation technique exclusively on all our client systems. It saves a lot of time.

8 replies
  1. ken mcfadden
    ken mcfadden says:

    This seems to work. How do you use this to process thru the data returned and do something with it? Like make a csv or something….Moving this out of the shell and into a .py program? Any examples for that?

    Reply
  2. Ken Harding
    Ken Harding says:

    Hello Alan,

    I updated Yum to the current version using ACS but ibm-iaccess is not in the list to install.
    What do you suggest?

    Thanks,
    Ken

    Reply
    • Alan Seiden
      Alan Seiden says:

      Ken, you’re on IBM i 7.3 or higher, right?
      Run
      /qopensys/pkgs/bin/yum repolist
      from SSH, QSH, or CALL QP2TERM
      and look for the repo:
      ibmi-release.
      Do you see ibmi-release?
      You may need to run
      /qopensys/pkgs/bin/yum clean all
      as well.

      Reply
      • Ken Harding
        Ken Harding says:

        Alan, 7.3 TR10. Ran both commands. Do not see ibmi-release. I do see ibm. I get this message when I run /qopensys/pkgs/bin/yum repolist
        [Errno 14] curl#60 – “SSL certificate problem: self signed certificate in certificate chain”. Not sure if that is causing a problem. It does try other mirror and succeed. Do I need to install something else?
        Thanks, Ken

        Reply
  3. Jon Paris
    Jon Paris says:

    Useful info Alan but with one small problem for me. I had previously used the old System i Access ODBC driver. Although all the instructions provided work as expected – when it comes to exiting SQL I get the error message:

    SQL> exit
    [37000][IBM][System i Access ODBC Driver][DB2 for i5/OS]SQL0199 – Keyword EXIT not expected. Valid tokens: ( CL END GET SET TAG CALL DROP FREE HOLD LOCK OPEN WITH ALTER.
    [ISQL]ERROR: Could not SQLPrepare

    To get out of SQL I have to type “quit”. So why am I connection to the old version? I started SQL with the command you gave (i.e. /QOpenSys/pkgs/bin/isql -v *LOCAL). Perhaps more importantly how do I get rid of the old one.

    Reply

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.