×
The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.
On Mon, Jul 8, 2019 at 2:43 PM Jason Olson <josys36@xxxxxxxxx> wrote:
There seems to be a few things that don't work the same on IBM i Python as
they do on Windows Python. For instance, reading data from IBM i tables I
have had to do one method on Windows and another on IBM i.
With the recent release of the ODBC driver for PASE (downloadable from
the same place that you get ACS), the small differences in reading
tables is reduced to nothing.
Even before this driver became available, the only significant
difference was one import statement at the top and the connection
info. From Windows:
import pyodbc
conn = pyodbc.connect(
driver='{IBM i Access ODBC Driver}',
system='1.2.3.4',
uid='username',
pwd='password')
From PASE:
import ibm_db_dbi
conn = ibm_db_dbi.connect()
Other than that, you could use identical code for working with Db2 for
i tables from both Windows and PASE. While there are other minor
differences between pyodbc and ibm_db_dbi, it is still quite simple to
write code that works for both.
Notice that ibm_db_dbi from PASE doesn't require any connection
information at all if you just want to use the credentials of
whichever user is running the script. But now, with the new ODBC
driver for PASE, you can use the Windows code verbatim on PASE, if you
want.
John Y.
As an Amazon Associate we earn from qualifying purchases.