Mike H schrieb:
Thanks to all of you.

FYI, I'm doing this because I'm working on creating some insert
statements in SQL, where string values need to be quoted, and integer
values need to be unquoted.

I wanted to be sure that I could pass these values to the list in a
normal way e.g. ['test', 1, 'two'] and have a function correct the
list for me, rather than calling the function with a strangely quoted
list e.g. ['"'test'"', 1, '"'two'"'].>

Don't do that yourself. This is error-prone. Instead, use the parametrized verison of the cursor.execute-method. It will perform the necessary escaping, and depending on the database and database adapter you use better performance.

Diez
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to