Insert blob data to MySQL
Gerhard Häring
gerhard at bigfoot.de
Sat May 4 05:27:50 EDT 2002
Steve Holden wrote in comp.lang.python:
> "Billy Ng" <kwokng at earthlink.net> wrote ...
>> Hi folks,
>>
>> Would any body tell me how to insert a blob object to the mysql blob field
>>
>
> Here "cc" is a cursor on a MySQLdb connection ...
>
>>>> cc.execute("""CREATE TABLE blobtbl (
> ... i integer primary key auto_increment,
> ... b blob)""")
> 0L
> [...]
> must-remember-to-delete-that-table-ly y'rs - steve
Aren't transactions cool? ;-)
PostgreSQL-rules-ly yours,
Gerhard
PS: I know you could get transactions by using a different table type
in the CREATE statement.
--
mail: gerhard <at> bigfoot <dot> de registered Linux user #64239
web: http://www.cs.fhm.edu/~ifw00065/ OpenPGP public key id AD24C930
public key fingerprint: 3FCC 8700 3012 0A9E B0C9 3667 814B 9CAA AD24 C930
reduce(lambda x,y:x+y,map(lambda x:chr(ord(x)^42),tuple('zS^BED\nX_FOY\x0b')))
More information about the Python-list
mailing list