Python, Mysql, insert NULL

Laszlo Zsolt Nagy gandalf at designaproduct.biz
Wed Oct 5 13:14:56 CEST 2005


>
> BTW, you did not write which driver are you using.

Oh, you did. Sorry. :-( Import your DB module 'yourmodule' and then

print yourmodule.paramstyle

Description of paramstyle is also in PEP249:

        paramstyle
          
            String constant stating the type of parameter marker
            formatting expected by the interface. Possible values are
            [2]:

                'qmark'         Question mark style, 
                                e.g. '...WHERE name=?'
                'numeric'       Numeric, positional style, 
                                e.g. '...WHERE name=:1'
                'named'         Named style, 
                                e.g. '...WHERE name=:name'
                'format'        ANSI C printf format codes, 
                                e.g. '...WHERE name=%s'
                'pyformat'      Python extended format codes, 				
				e.g. '...WHERE name=%(name)s'


Best,

   Les

                                e.g. '...WHERE name=%(name)s'





More information about the Python-list mailing list