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



Yeah, I misspoke there. 2.0.5.1 was the version of ibm_db (and ibm_db_dbi)
that originally shipped. The changes to make ibm_db_dbi work properly for
IBM i went in to 2.0.5.2 (SI58191).


I was able to get the latest version of Python and ibm_db installed on
Litmis Spaces if anyone wants to give it a try. The "None" for username
and password works. If you have an existing Python Space you will need to
delete it and create a new one. To get ibm_db to work I had to run this
command, not sure if this is normally necessary.

pip install
/QOpenSys/QIBM/ProdData/OPS/Python-pkgs/ibm_db/ibm_db-2.0.5.4-cp34-cp34m-os400_powerpc.w
hl

----Test Program---
import ibm_db
db_name = '*LOCAL'
schema = '<insert Litmis Space Schema>'
username = None
password = None
try:
conn = ibm_db.connect(db_name, username, password)
except:
print("no connection:", ibm_db.conn_errormsg())
if conn:
result_set = ibm_db.exec_immediate(conn, "SET SCHEMA " + schema)
result_set = ibm_db.exec_immediate(conn, "CREATE TABLE CUSTOMER ( CUSNUM
NUMERIC(6, 0), LSTNAM VARCHAR(50) )")
result_set = ibm_db.exec_immediate(conn, "INSERT INTO CUSTOMER VALUES
(123,'Smith')")
result_set = ibm_db.exec_immediate(conn, "SELECT * FROM CUSTOMER")
ibm_db.fetch_row(result_set)
print(ibm_db.result(result_set, 0))
print(ibm_db.result(result_set, 1))
ibm_db.close(conn)
else:
print ('connection failed')


Aaron Bartell
litmis.com - Services for open source on IBM i

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.