0

I am trying to connect to a DB2 database using python. For this I am using the ibm_db_dbi package.

The problem is that when I try to make the connection, I get the following error:

ibm_db_dbi.ProgrammingError: ibm_db_dbi::ProgrammingError: [IBM][CLI Driver] SQL30073N  "0x2110" Parameter value "0x0000" is not supported.  SQLSTATE=58017\r SQLCODE=-30073

The connection:

import ibm_db_dbi as db

conn = db.connect("DATABASE=myDB;HOSTNAME=myHost;PORT=myPort;PROTOCOL=TCPIP;UID=user;PWD=pass;", "", "")

Does anyone know what the problem is?

P.S.: I have also tried to specify the driver, but the error continues.

Windows 10 / Python 3.7.8 / DB2 z/OS

Xabagiar
  • 9
  • 1
  • please edit your question to add facts (please do not add comments), your operating-system details(version + name), your python version and bitness, the plain text output of `pip freeze` (or `pip3 freeze` depending on your versions), and whether you are able to connect to the same database with the same connection credentials via the CLI (with the command `db2cli validate -dsn xxx -user yyy -passwd zzz` after creating the dsn details in the `db2dsdriver.cfg` xml file according to the documentation). – mao Jun 15 '21 at 09:24
  • Also remember than in your connection string, the values of the parameters (e.g. myDB, myHost, myPort, UID, PWD) must be correct, so it is always useful to print out your connection string before connecting , to validate it is what you assume it to be. – mao Jun 15 '21 at 09:26
  • From a quick search, it looks like you are using the connect() function from ibm_db. As I understand it, ibm_db_dbi provides a wrapper for this, and the parameters for the connect() function are not the same. I found this link: https://www.idug.org/blogs/john-maenpaa1/2021/01/22/db2-python-programing-hdbc-vs-hdbi which has code to use the connect() function for both ibm_db, and ibm_db_dbi. – DS_London Jun 15 '21 at 09:47

0 Answers0