[DB-SIG] API suggestion: expose 'quote' method
mal at lemburg.com
Wed Jun 4 11:02:22 EDT 2003
Chris Cogdon wrote:
> But... I DO understand the difficulty in exposing a function that
> doesn't currently exist (such as the ODBC driver). And it may NOT be
> worth the difficulty in adding that functionality as a requirement for a
> later API. (Perhaps optional? At least if it's doable, we could get a
> consistent interface).
That we could do, but note that quoting would be requiring type
information in database specific ways, plus it may sometimes also
need encoding or code page information for string values, e.g.
a database running with UTF-8 code page will want to see UTF-8
in string literals.
BTW, ODBC has a function called SQLNativeSql() which returns the
rewritten SQL statement in the database backend SQL dialect.
Not all drivers implement this and those that do only deal with
ODBC quoted SQL functions or joins. If it were an easy to have API,
believe me, Microsoft would have put that into the standard as well
Professional Python Software directly from the Source (#1, Jun 04 2003)
>>> Python/Zope Products & Consulting ... http://www.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/
EuroPython 2003, Charleroi, Belgium: 20 days left
More information about the DB-SIG