Hello, Ian!
>>> from DB import dbConn
1/Pool : ACQUIRE pool=[]
>>> from sqlobject.sqlbuilder import Insert
>>> insert = Insert("table", values={"name": "val'ue"})
>>> dbConn.sqlrepr(insert)
"INSERT INTO table (name) VALUES ('val''ue')"
Oops, that's wrong. Like in _likeQuote. MySQL and Postgres use \' to
quote apostrophe, not ''.
converters.sqlStringReplace[1] = ("'", "\\'")
(at least for Postgres and MySQL).
Oleg.
--
Oleg Broytmann http://phd.pp.ru/ ph...@ph...
Programmers don't die, they just GOSUB without RETURN.
|