Hello.

Here is what caused problems for me with both mySQL and PostgreSQL:

ns_dblist $h "SELECT lower([ns_dbquotevalue {ABC'DEF\'}])"

Basically it quoted the string into 'ABC''DEF\'', which is not correct.

Also, it does not work correctly for UTF-escapable characters.

proc ns_dbquotevalue {val} {
     set val [string map [list "'" "''" "\\" "\\\\"] $val]
     return "'$val'"
}

Here's the code I used - it does not handle datatypes, but I never used
them anyway :)

Any comments on this one?

--
WK

Reply via email to