× 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.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.