Vernon Cole wrote:
> When one is using a generic database access tool, such as ADO or ODBC, it is
> possible that the programmer does not know in advance what database engine
> will eventually be used.
> 
> Since different engines have vastly different requirements [1] it would be
> nice for the programmer to be able to determine which database engine his
> user has handed him.
> 
> Is there any sort of standard or usual way that information may be
> obtained?  (If egenix has an extension for this I will happily adopt it.)

We use the connection attributes .dbms_name and .dbms_version for
this in mxODBC and mxODBC Connect:

    http://www.egenix.com/products/python/mxODBC/doc/#_Toc269754563

> [1] for example, do I use TOP or LIMIT to restrict the number of rows in a
> result set?

The database engine version is usually more interesting than the
engine name (which is typically fixed for an application). With the
version you can easily determine whether advanced SQL features are
available or not.

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Feb 15 2011)
>>> 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 our new mxODBC.Connect Python Database Interface for free ! ::::


   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
    D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
           Registered at Amtsgericht Duesseldorf: HRB 46611
               http://www.egenix.com/company/contact/
_______________________________________________
DB-SIG maillist  -  DB-SIG@python.org
http://mail.python.org/mailman/listinfo/db-sig

Reply via email to