[DB-SIG] pyformat Parameter Style

Andy Todd andy47 at halfcooked.com
Sat May 10 19:23:40 EDT 2003


Is there a definitive specification of the pyformat parameter style 
anywhere?

The usual sources come up dry. It is mentioned in the DB-API 
specification (http://www.python.org/peps/pep-0249.html) but not defined.

It seems from observation that one should simply put '%(<parameter 
name>)s' in the query string and then pass a mapping with a 
corresponding key when calling the execute method. But I'd just like to 
make absolutely sure.

In particular, I'm curious if the 's' actually means anything (like 
string?). Should I be using different characters for different data 
types, and if so, which ones?

Regards,
Andy
-- 
--------------------------------------------------------------------------------
 From the desk of Andrew J Todd esq - http://www.halfcooked.com/




More information about the DB-SIG mailing list