Hi ,
I 'm encountering error when connecting to ibm_db (DB2 on zos with variables in connection string. hardcoded connection string works fine.
For ex:
ibm_db.connect("DATABASE=dbname;HOSTNAME=host;PORT=port;PROTOCOL=tcpip;uid=uid;PWD=pwd;", "", "") - This works fine
But
connstr = '''"DATABASE={0};HOSTNAME={1};PORT={2};PROTOCOL=tcpip;uid={3};PWD={4};"'''.format(db, self.sid, port, self.uid, self.pwd)
ibm_db.connect(connstr, "", "")
- This doesnt work and throws error Exception: [IBM][CLI Driver] CLI0199E Invalid connection string attribute. SQLSTATE=08001 SQLCODE=-99999
there should be a way to pass variables to connection string right ? What am I Missing here ?