[DB-SIG] How to connect to informix DB in an easy way

santi1 srlopez at policlinicagipuzkoa.com
Mon Sep 7 17:38:47 CEST 2009


Provably, now you has solve the problem.
In windows download 'InformixDB-2.5.win32-py2.5.exe', and install.
Then the code is easy, i used this for reading BLOBS.
Dont forget to install InformixConnect and setup the variables for Host and
server .

import sys
import informixdb
import os

conn = informixdb.connect('database at server', 'user', 'password')
cursor = conn.cursor(rowformat = informixdb.ROW_AS_DICT)
cursor.execute("SELECT * FROM blobtable WHERE handle=457034")
f=open('file.doc', 'wb+')
for row in cursor:
  f.write(row['contenido'])
f.close()
cmd = 'file.doc'
os.system(cmd)
conn.commit()
conn.close()
sys.exit(0)

-- 
View this message in context: http://www.nabble.com/How-to-connect-to-informix-DB-in-an-easy-way-tp25076131p25332401.html
Sent from the Python - db-sig mailing list archive at Nabble.com.



More information about the DB-SIG mailing list