D
Daniel
Hello,
I'm developing an application that accesses both a MySQL and an SQLite
database. I would like to have named parameters in my SQL and have
found the following:
For MySQL my named parameters need to look like this: %(paramname)s
For SQLite my named parameters need to look like this: aramname
I have read in PEP249 (http://www.python.org/dev/peps/pep-0249/) that
there are five paramstyles, though it wasn't clear if I should expect
these to be implemented in all DBAPI2 compliant modules. I have found
that I can set the paramstyle, but it doesn't seem to apply:
'pyformat'
My sqlite access still requires the 'named' format and not
'pyformat'.
Can someone tell me if it's possible to configure a connection or
cursor to use a particular paramstyle?
Thanks.
I'm developing an application that accesses both a MySQL and an SQLite
database. I would like to have named parameters in my SQL and have
found the following:
For MySQL my named parameters need to look like this: %(paramname)s
For SQLite my named parameters need to look like this: aramname
I have read in PEP249 (http://www.python.org/dev/peps/pep-0249/) that
there are five paramstyles, though it wasn't clear if I should expect
these to be implemented in all DBAPI2 compliant modules. I have found
that I can set the paramstyle, but it doesn't seem to apply:
'pyformat'
My sqlite access still requires the 'named' format and not
'pyformat'.
Can someone tell me if it's possible to configure a connection or
cursor to use a particular paramstyle?
Thanks.