Connect and query table in DB2 using iSeries ODBC

Posted on 2005-05-02
Last Modified: 2008-02-01
I have a code in C++ that uses
1. Connects to the target database using ODBC connection created on the system.
2. executes sql queries on the table defined in the code. e.g. Select first_name, last_name from tblNames

Everything works fine with other ODBC's i.e. SQL server / oracle / msaccess ,etc. But for DB2 i am not able to reach the correct database / table.

I need help configuring correct odbc. Following are the details:

Driver(s) available: 1. Client Access ODBC Driver (32bit) - IBM Corporation
               2. IBM DB2 ODBC Driver - International Buisness Machines Corporation
               3. iSeries Access ODBC Driver - IBM Corporation

The information available from client is:
Table name
iSeries Name
ip Address

I configured a connection using drivers 1 & 3 above and was able to connect with the information available. However when i use SQLcon32 utility to get list of tables, i see the tables from QGPL and nothing from the Database/library that i am interested in. Also i tried to run sql query "Select * from libraryname.tblname" but the driver complains "[IBM][iSeries Access ODBC Driver][DB2 UDB]SQL0204 - [Table name] in [DB] type *FILE not found.

Any ideas?
Question by:picasothakkar
    1 Comment
    LVL 18

    Accepted Solution

    You might try "libraryname/tblname" instead of "libraryname.tblname". If your ODBC data-source is configured with a naming convention of *SYS (instead of *SQL), then it'll look for slash instead of period.


    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    Recursive SQL in UDB/LUW (you can use 'recursive' and 'SQL' in the same sentence) A growing number of database queries lend themselves to recursive solutions.  It's not always easy to spot when recursion is called for, especially for people una…
    Recursive SQL in UDB/LUW (it really isn't that hard to do) Recursive SQL is most often used to convert columns to rows or rows to columns.  A previous article described the process of converting rows to columns.  This article will build off of th…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now