[DB-SIG] paramstyle specification (was: Two sample implementations of ['named', 'qmark'] auto switch (a report))
Michael Bayer
mike_mp at zzzcomputing.com
Tue May 21 20:55:05 CEST 2013
On May 21, 2013, at 2:30 PM, M.-A. Lemburg <mal at egenix.com> wrote:
>
> Something we do need to address in a paramstyle spec for
> qmark and named is SQL comments. Perhaps easiest would be
> to disallow them in SQL statements passed to .execute*().
um, meaning no SQL comments allowed in a call to cursor.execute() ? That would be a really big problem for folks who pass comments in their SQL as a means to help with database query log parsing. There are definitely folks who do that, and it's very useful.
>
> PS: mxODBC 3.2 implements both styles and does conversion from
> named to qmark. When choosing named style, we explicitly disallow
> question marks to appear in the SQL statement to detect errors
> early and give proper error messages to the user, rather than
> some obscure "too few parameters for statement".
you used the word "underspecified" a moment ago which I found frightening, but then three paragraphs later it's just the word I need - I think KISS should be the rule here, the parser is only aware of one paramstyle at a time, and doesn't try to do any nannying of things that look like other paramstyles.
More information about the DB-SIG
mailing list