Thanks for continuous support,
I have tried to change ExtendedDynamic to either values, but still no luck.
When I use iSQL I get successful connection, but when executing query I get an error:
+---------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
+---------------------------------------+
SQL> SELECT * FROM IIM
When I execute python scripts that runs same query using same connection with pyodbc, I get this very generic error:
pyodbc.Error: ('HY000', '[HY000] [IBM][System i Access ODBC Driver][DB2 for i5/OS]PWS0001 - Function did not complete successfully. (69798) (SQLExecDirectW)')
Here is my DSN:
[AS400]
Description = IBM i Access ODBC Driver
Driver = IBM i Access ODBC Driver
System = <domain name>
UserID = <user>
Password = <password>
Naming = 0
DefaultLibraries = ENGBPCSF
Database =
ConnectionType = 0
CommitMode = 2
ExtendedDynamic = 0
DefaultPkgLibrary = QGPL
DefaultPackage = A/DEFAULT(IBM),2,0,1,0,512
AllowDataCompression = 1
LibraryView = 0
AllowUnsupportedChar = 0
ForceTranslation = 0
Trace = 0
Here are my driver configurations:
[IBM i Access ODBC Driver]
Description=IBM i Access for Linux ODBC Driver
Driver=/opt/ibm/iaccess/lib/libcwbodbc.so
Setup=/opt/ibm/iaccess/lib/libcwbodbcs.so
Driver64=/opt/ibm/iaccess/lib64/libcwbodbc.so
Setup64=/opt/ibm/iaccess/lib64/libcwbodbcs.so
Threading=0
DontDLClose=1
UsageCount=1
[IBM i Access ODBC Driver 64-bit]
Description=IBM i Access for Linux 64-bit ODBC Driver
Driver=/opt/ibm/iaccess/lib64/libcwbodbc.so
Setup=/opt/ibm/iaccess/lib64/libcwbodbcs.so
Threading=0
DontDLClose=1
UsageCount=1
I have included cwbmedic, cwbdetail and odbc logs in case if this can help:https://drive.google.com/drive/folders/1q5ehBikhutQ6Zw2NaQexaZ-o2ssyzl0c?usp=sharing
------------------------------
Dainis Lubgans
------------------------------
Original Message:
Sent: Wed July 26, 2023 10:03 PM
From: Satid Singkorapoom
Subject: IBM i Access ODBC for Linux
By the way, what is the release of your IBM i ?
You may want to start ODBC traceing in order to see more information. Instruction is here : Must Gather Diagnostic Material for IBM i Access Client Solutions (ACS) Linux Application Package ODBC Problems at https://www.ibm.com/support/pages/must-gather-diagnostic-material-ibm-i-access-client-solutions-acs-linux-application-package-odbc-problems
------------------------------
Education is not the learning of facts but the training of the mind to think. -- Albert Einstein.
------------------------------
Satid S.
Original Message:
Sent: Wed July 26, 2023 06:12 AM
From: Dainis Lubgans
Subject: IBM i Access ODBC for Linux
Hi Satid Singkorapoom,
Appreciate your prompt response. I think there is a bit of misunderstanding. When I mentioned Windows, I meant that we have other machines that are windows PC's. Drivers on those are iSries Aceess ODBC drivers that are a bit old, however when I tested my python script on those machines everything worked as expected. Now I'm building an application which will be reporting tool that gets and displays the data. My application runs in docker container which is Linux based. I have installed linux i access odbc drivers ("IBM i Access ODBC driver", "IBM i Access ODBC driver 64-bit") on it and also tested with iSQL, which reports back successful connection, however, when I try to execute queries I get a very generic error: "Function did not complete successfully." and "Could not SQL Prepare". Just thinking if there anything else that needs to be installed along the driver. Could be also that some driver configurations need to be different compared to those on windows.
------------------------------
Dainis Lubgans
Original Message:
Sent: Wed July 26, 2023 02:53 AM
From: Satid Singkorapoom
Subject: IBM i Access ODBC for Linux
Dear Dainis
From what you described, it sounds like you use a very old ODBC driver for Windows rather than one for Linux. (And I wonder how you installed it into Debian in the first place?) You should install IBM i ODBC driver for Linux from IBM i ACS' Linux Application Package which is downloaded from IBM Entitled Systems Support web site. You need to create an IBM ID to use it and it is free of charge. This article explains how to download it : https://techchannel.com/SMB/06/2019/acs-application-packages
These web sites also have additional information that may be useful fro you on IBM i ACS ODBC driver for Linux :
https://github.com/IBM/ibmi-oss-docs/blob/master/odbc/installation.md#linux
https://www.ibm.com/docs/en/i/7.2?topic=package-i-access-odbc
------------------------------
Education is not the learning of facts but the training of the mind to think. -- Albert Einstein.
------------------------------
Satid S.
Original Message:
Sent: Tue July 25, 2023 11:51 AM
From: Dainis Lubgans
Subject: IBM i Access ODBC for Linux
Hi all. I'm looking for someone with a better knowledge, who can help me in this situation.
Scenario
I'm trying to connect to IBM i Systems (AS400) from docker container, which is based on Linux(Debian).
I did get the drivers from IBM repository which are "IBM i Access ODBC Driver 64-bit" and "IBM i Access ODBC Driver".
Result:
By testing connection to IBM i System connection is successful, however, when I try to execute sql i get an error: "[IBM][System i Access ODBC Driver][DB2 for i5/OS]PWS0001 - Function did not complete successfully. (69798) (SQLExecDirectW)')" and there is no more information on the error. I use python and pyodbc to query the database. Query and user permissions are also correct as same script runs fine on windows machine with windows iSeries Access ODBC drivers.
BPCS/AS400 our organisation is using is very old and windows drivers that work for other windows machines are dated to year 2009.
Thanks for any help in advance.
------------------------------
Dainis Lubgans
------------------------------