ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> db-sig
db-sig
Re: [DB-SIG] paramstyles (mysql string length?)
by M.-A. Lemburg other posts by this author
Apr 19 2006 5:25AM messages near this date
Re: [DB-SIG] mysql string length? | Re: [DB-SIG] paramstyles (mysql string length?)
Andy Todd wrote:
>  Once more, %s is simply a marker in the statement you provide to the 
>  execute method which says "substitute the next item from the tuple I've 
>  provided here please". It is not string substitution.
>  
>  Now hands up for changing the DB-API to remove the pyformat paramstyle? 
>  If we're going to have options I think we should restrict them to either 
>  named parameters (a la cx_Oracle) or the '?' qmark (a la ODBC and JDBC).

Since this sort of confusion comes up again and again, I'm +1 on
removing 'pyformat' and 'format' in the next version of the DB-API
(and maybe marking it for deprecation in PEP 249 now).

I've found the qmark style to be sufficient for everything, but
then, I'm biased. For the few cases where binding variables
are not allowed in SQL (e.g. table names), I use standard Python
string formatting. Even then, things look very straight forward
in the code: %s is a Python formatting marker, ? is a bound
parameter.

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Apr 19 2006)
> >> Python/Zope Consulting and Support ...        http://www.egenix.com/
> >> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
> >> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________

::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! ::::
_______________________________________________
DB-SIG maillist  -  DB-SIG@[...].org
http://mail.python.org/mailman/listinfo/db-sig
Thread:
Lukasz Szybalski
Andrew Chambers
Lukasz Szybalski
Andy Todd
Engelbert Gruber
Andy Todd
Engelbert Gruber
Lukasz Szybalski
Lukasz Szybalski
Andy Todd
Lukasz Szybalski
M.-A. Lemburg
Ian Bicking
Gerhard Häring
Ian Bicking
Carsten Haese
Gerhard Häring
Carsten Haese
Carsten Haese
Python
Engelbert Gruber
Andy Dustman

Privacy Policy | Email Opt-out | Feedback | Syndication
© 2004 ActiveState, a division of Sophos All rights reserved