Error connecting to Informix using ibm_db

210 views
Skip to first unread message

Rajesh Gupta

unread,
Jul 1, 2019, 10:59:52 PM7/1/19
to ibm_db

Hi,
I am trying to connect to Informix DB using Python ibm_db package from windows 

Here is my connection string"

conn= ibm_db.connect ("Hostname=Host ; Post=1900; Protocol = ONSOCTCP; DATABASE=<DB NAME> ; UID=<user_id>; pwd=<password>", "","")


But i am getting the error
The Database alias name or database  name ""  could not be found . SQLSTATE=42705 SQLCODE =-1013

Could you please let me know what could be the issue?


thanks,
Rajesh

Saba Kauser

unread,
Jul 1, 2019, 11:04:19 PM7/1/19
to ibm_db
Hi Rajesh,
use Protocol =tcpip and port=<drda_port_no_for_informix_connections> in the connection string. Make sure the database name is valid and it exist on server.

Rajesh Gupta

unread,
Jul 10, 2019, 9:55:54 AM7/10/19
to ibm_db

I installed the linux64_odbc_cli,tar.gz on the machine.

Now i am getting the error ,

Exception: [IBM][CLI Driver] SQL1032N No start database maanager command was issued. SQLSTATE=57019 SQLCODE=-1032

do we need to use ibm_db for Informix or IfxPy ? I dont see wheel  linux 64 package for IFxPy?

Please let me know which is the asy way to connect to Informix, I am struggling to connect to Informix DB.

thanks a lot 

~Rajesh

Saba Kauser

unread,
Jul 10, 2019, 9:57:23 AM7/10/19
to ibm_db
can you run "db2level" from command line and share the output.
Also share the connection string you are using.

Rajesh

unread,
Jul 11, 2019, 12:10:42 AM7/11/19
to ibm...@googlegroups.com
Hi Saba,

db2level its command not found.

Here is my connection string

conn= ibm_db.connect ("Hostname=Host ; Post=1900; Protocol = ONSOCTCP; DATABASE=<DB NAME> ; Instance=vec_sandbox; UID=<user_id>; pwd=<password>", "","")



Thanks & Regards,
Rajesh Gupta

--
You received this message because you are subscribed to the Google Groups "ibm_db" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ibm_db+un...@googlegroups.com.
To post to this group, send email to ibm...@googlegroups.com.
Visit this group at https://groups.google.com/group/ibm_db.
To view this discussion on the web visit https://groups.google.com/d/msgid/ibm_db/d3d243f7-ee8a-44c5-8d59-1fc969e60a6b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Saba Kauser

unread,
Jul 11, 2019, 12:18:16 AM7/11/19
to ibm_db
Hi Rajesh,

I don't think you have passed correct informix connection details. The error sql1032N indicates connection to Db2 LUW and the server instance is not started yet.
You need to setup Informix for DRDA connection and use that port for connections from ibm_db.

Follow these steps to configure

1.    Edit the $INFORMIXSQLHOSTS - Add a NEW entry for DRDA Server with PORT number
InformixServerName onsoctcp HOSTNAME PORT

InformixServerName_drda drsoctcp HOSTNAME PORT_drda

2.    Edit the $INFORMIXDIR/etc/$ONCONFIG to include drda server alias
DBSERVERNAME InformixServerName

DBSERVERALIASES InformixServerName_drda

3.    Restart the server
4.    Try the Connection now using PORT_drda

You also seem to be using the instance-based client(full client) or LUW Db2 server installation for ibm_db's dependency on odbc driver.
Unset IBM_DB_HOME, and do "pip install ibm_db". this would install the clidriver under python ibm_db installation in site-packages.
Check you PATH setting to see if you have SQLLIB/bin. If you do not intend to use the server installation, the update PATH with path to clidriver/bin, clidriver/adm and LIB to clidriver/lib.
Hi Saba,
To unsubscribe from this group and stop receiving emails from it, send an email to ibm_db+unsubscribe@googlegroups.com.

Rajesh

unread,
Jul 16, 2019, 8:26:21 AM7/16/19
to ibm...@googlegroups.com
Thanks Saba, will try the below steps but not sure I will have access to modify informix files and restart the server.

Is there any way I can connect using ifxpy module.  I have installed client SDK with the help of Dba ??]


Thanks & Regards,
Rajesh Gupta

Hi Saba,
To unsubscribe from this group and stop receiving emails from it, send an email to ibm_db+un...@googlegroups.com.

To post to this group, send email to ibm...@googlegroups.com.
Visit this group at https://groups.google.com/group/ibm_db.
To view this discussion on the web visit https://groups.google.com/d/msgid/ibm_db/d3d243f7-ee8a-44c5-8d59-1fc969e60a6b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "ibm_db" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ibm_db+un...@googlegroups.com.

To post to this group, send email to ibm...@googlegroups.com.
Visit this group at https://groups.google.com/group/ibm_db.

Saba Kauser

unread,
Jul 16, 2019, 8:38:23 AM7/16/19
to ibm_db
Hi Rajesh,

For Db2 LUW clients to connect to informix, you must have the server configured to listen on drda port.
You can use ifxpy but this also requires you to pass correct port no for service parameter. I am not sure how informix ODBC driver is designed. You can try connecting and share your results.
Hi Saba,
To unsubscribe from this group and stop receiving emails from it, send an email to ibm_db+unsubscribe@googlegroups.com.

To post to this group, send email to ibm...@googlegroups.com.
Visit this group at https://groups.google.com/group/ibm_db.
To view this discussion on the web visit https://groups.google.com/d/msgid/ibm_db/d3d243f7-ee8a-44c5-8d59-1fc969e60a6b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "ibm_db" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ibm_db+unsubscribe@googlegroups.com.

Rajesh

unread,
Jul 16, 2019, 10:53:10 PM7/16/19
to ibm...@googlegroups.com
Hi Saba,

I was able to connect to Informix finally using pyodbc package by following the steps mentioned here


 But now I am facing another issue:)

To load the text file into Informix Database. I can select, update, insert and delete but i need to load the bulk data.


Appreciate your help.


Thanks,
Rajesh 



Thanks & Regards,
Rajesh Gupta


Hi Saba,
To unsubscribe from this group and stop receiving emails from it, send an email to ibm_db+un...@googlegroups.com.

To post to this group, send email to ibm...@googlegroups.com.
Visit this group at https://groups.google.com/group/ibm_db.
To view this discussion on the web visit https://groups.google.com/d/msgid/ibm_db/d3d243f7-ee8a-44c5-8d59-1fc969e60a6b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "ibm_db" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ibm_db+un...@googlegroups.com.

To post to this group, send email to ibm...@googlegroups.com.
Visit this group at https://groups.google.com/group/ibm_db.
To view this discussion on the web visit https://groups.google.com/d/msgid/ibm_db/f3bda09f-a12f-4581-b4ca-e488f8bd0d58%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "ibm_db" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ibm_db+un...@googlegroups.com.

To post to this group, send email to ibm...@googlegroups.com.
Visit this group at https://groups.google.com/group/ibm_db.

Saba Kauser

unread,
Jul 16, 2019, 11:12:28 PM7/16/19
to ibm_db
Hi Rajesh,

pyodbc is not my area of expertise. I have the informix server on a windows which I can access using the drda port from ibm_db that uses db2 ODBC driver.
I see you are using Informix ODBC driver via UnixODBC driver manager from pyodbc that uses ODBC driver manager library.

You might need to contact pyodbc owners for assistance.
 HTH.
Hi Saba,
To unsubscribe from this group and stop receiving emails from it, send an email to ibm_db+unsubscribe@googlegroups.com.

To post to this group, send email to ibm...@googlegroups.com.
Visit this group at https://groups.google.com/group/ibm_db.
To view this discussion on the web visit https://groups.google.com/d/msgid/ibm_db/d3d243f7-ee8a-44c5-8d59-1fc969e60a6b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "ibm_db" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ibm_db+unsubscribe@googlegroups.com.

To post to this group, send email to ibm...@googlegroups.com.
Visit this group at https://groups.google.com/group/ibm_db.
To view this discussion on the web visit https://groups.google.com/d/msgid/ibm_db/f3bda09f-a12f-4581-b4ca-e488f8bd0d58%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "ibm_db" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ibm_db+unsubscribe@googlegroups.com.

Rajesh

unread,
Jul 17, 2019, 2:17:59 AM7/17/19
to ibm...@googlegroups.com
Thanks Saba, I have submitted the issue there :)


Thanks & Regards,
Rajesh Gupta

Hi Saba,
To unsubscribe from this group and stop receiving emails from it, send an email to ibm_db+un...@googlegroups.com.

To post to this group, send email to ibm...@googlegroups.com.
Visit this group at https://groups.google.com/group/ibm_db.
To view this discussion on the web visit https://groups.google.com/d/msgid/ibm_db/d3d243f7-ee8a-44c5-8d59-1fc969e60a6b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "ibm_db" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ibm_db+un...@googlegroups.com.

To post to this group, send email to ibm...@googlegroups.com.
Visit this group at https://groups.google.com/group/ibm_db.
To view this discussion on the web visit https://groups.google.com/d/msgid/ibm_db/f3bda09f-a12f-4581-b4ca-e488f8bd0d58%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "ibm_db" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ibm_db+un...@googlegroups.com.

To post to this group, send email to ibm...@googlegroups.com.
Visit this group at https://groups.google.com/group/ibm_db.
To view this discussion on the web visit https://groups.google.com/d/msgid/ibm_db/009c9253-18b2-47bd-8b68-dbff122eb4b0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "ibm_db" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ibm_db+un...@googlegroups.com.

To post to this group, send email to ibm...@googlegroups.com.
Visit this group at https://groups.google.com/group/ibm_db.
Reply all
Reply to author
Forward
0 new messages