[DB-SIG] Towards a single parameter style

M.-A. Lemburg mal@lemburg.com
Mon, 17 Feb 2003 19:29:13 +0100


Anthony Tuininga wrote:
> Ah yes. I should have checked first. ODBC is supported on most platforms
> and there is iODBC which is an Open Source initiative since ODBC was
> originally a solely Windows solution.

There's also unixODBC which is another Open Source ODBC manager
for Unix.

> I've never had good experience
> with ODBC and neither have any of my counterparts. ODBC works great for
> simple boring queries but as soon as things get complex, the different
> drivers behave differently and you can't get access (easily) to the
> power of the database. In other words, with ODBC, pick the lowest common
> denominator and stay there. Ugh.

That's a myth. Current ODBC drivers provide a very complete
set of features for pretty much every database out there.

The only downside is that you seomtimes may have to go to the
well-known ODBC driver vendors to get a properly coded driver
rather than using the one that came with the database.

Writing SQL for the different ODBC backends is another
story, though. It's also a myth that ODBC makes this much easier;
what sometimes helps is that you can at least query the backend for
support of certain SQL constructs and that ODBC also defines
a minimal SQL grammar which is binding for all drivers.

> On Mon, 2003-02-17 at 10:37, M.-A. Lemburg wrote:
> 
>>Anthony Tuininga wrote:
>>
>>>ODBC is (I believe) not common to all platforms, right? That makes it
>>>rather useless as a replacment for the Python DB API. Besides, the API
>>>is considerably different, right? That would make transition quite
>>>painful. But yes, a parsing bypass is a necessity for those cases where
>>>the parser can't handle something.
>>
>>Just to correct this:
>>
>>ODBC is a standard which is available on Windows, Unix and Mac OS X.
>>It takes care of whatever parameter style conversion is needed
>>and has support for both parameter binding aware backends as well
>>as ones which don't support this. It uses the 'qmark' parameter
>>style, BTW.
>>
>>mxODBC takes care of wrapping ODBC in a DB-API compatible way
>>and is available on Window, Unix and Mac OS X as well -- providing
>>the same consistent interface on all these platforms.
>>
>>So yes, ODBC is a solution. Whether it's the right solution
>>depends on your needs and requirements, YMMV.

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Software directly from the Source  (#1, Feb 17 2003)
 >>> Python/Zope Products & Consulting ...         http://www.egenix.com/
 >>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________
Python UK 2003, Oxford:                                     43 days left
EuroPython 2003, Charleroi, Belgium:                       127 days left