?iso-8859-1?Q?Re: Yet another problem with special character? ?iso-8859-1?Q?s ( , , , etc.)?

Hamish Lawson hamish_lawson at yahoo.co.uk
Thu Oct 10 12:59:54 EDT 2002


> cursor.execute('INSERT INTO %s (%s) VALUES %s' % (tab, key, val))

It's probably better to let your database module take care of quoting
and escaping the values to be inserted. The DB-API spec allows
placeholder parameters to be supplied to an execute call:

    http://www.python.org/topics/database/DatabaseAPI-2.0.html

Consult your documentation for the particular Python DB-API module
that you are using to find out what its paramaeter style is.


Hamish Lawson



More information about the Python-list mailing list