Home

python sql notes

Updated:
Created:

thinks to remember when working with python, mysql and maybe sqlalchemy

Passing bind parameters to like

c.execute("select * from brands where brandname like %%%s%%",('ooba',))

(to find 'Foobar') won't work in all its variations.

What will work:

c.execute("select * from brands where brandname like %s",("%%%s%%" % "ooba"))