Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

dbiRaw and odbc

0 views
Skip to first unread message

Peter Dyk

unread,
Nov 29, 2002, 1:45:19 PM11/29/02
to
A couple of posts asked how to manipulate the BLOB retrieved by a query via
the odbc module. The answer is to use the attribute "value":

dbc = odbc.odbc('AAA')
crsr = dbc.cursor()
crsr.execute("select * from IDWAAA")
row = crsr.fetchone()
f = open(imageFileName, "wb+")
f.write(row[idwphotofield1].value)

Make sure to open the file in binary mode!

There does not seem to be a whole lot of documentation around on the odbc
interface. For instance, I only by chance stumbled on the value attribute,
since it is a build-in.


0 new messages