problem with quoted strings while inserting into varchar field of database.

krishnakant Mane researchbase at gmail.com
Mon May 7 02:55:53 EDT 2007


On 6 May 2007 11:22:52 -0700, Daniele Varrazzo <daniele.varrazzo at gmail.com> >
> Every serious database driver has a complete and solid SQL escaping
> mechanism. This mechanism tipically involves putting placeholders in
> your SQL strings and passing python data in a separate tuple or
> dictionary. Kinda
>
>     cur.execute("INSERT INTO datatable (data) VALUES (%s);",
> (pickled_data,))
>
I will try doing that once I get back to the lab.
mean while I forgot to mention in my previous email that I use MySQLdb
for python-mysql connection.
I did not find any such reference to storing pickled objects in the API.

any Idea what could be done with the mysql python module I am using?
regards,
Krishnakant.



More information about the Python-list mailing list