On 3/30/13 8:45 AM, Ed Leafe wrote:
> You don't add the parameters in the addWhere call; you define the WHERE
> clause with addWhere(), and the parameters with setParams(). In your example,
> you'd write:
>
> biz.addWhere("yr = %s")
> biz.setParams(y)
> biz.requery()
>
> Note that if you are using SQLite as your database, the syntax for
> addWhere is slightly different:
>
> biz.addWhere("yr = ?")
You can also standardize with the question marks and pass convertQMarks to True
to
biz.requery(). This will work for MySQL and SQLite:
biz.addWhere("yr = ?")
biz.setParams(y)
biz.requery(convertQMarks=True)
It's very helpful when, like me, you have to support multiple database backends
in
your application.
Paul
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/[email protected]