Posted By:
Alex_Hall
Posted On:
Monday, August 19, 2002 03:55 PM
I am having problems with SQL INSERT type statements where consecutive escape characters are required, eg: for the source string "\'" I would expect the following code to work: "INSERT INTO ... VALUES('\\'')" Indeed, the above syntax works as expected in my DBMS's command line (I'm using MySQL with a JDBC driver). I consulted the Java documentation and hoped that specifying an alternative escape character might work, using the command {escape '[char]'} at the end of the SQL statement. However, I am still getting SQLException when I attempt to insert values containing consecutive escape characters. Is this standard JDBC behavior, or should I try to install a different JDBC driver?
More>>
I am having problems with SQL INSERT type statements where consecutive escape characters are required, eg: for the source string
"\'"
I would expect the following code to work:
"INSERT INTO ... VALUES('\\'')"
Indeed, the above syntax works as expected in my DBMS's command line (I'm using MySQL with a JDBC driver).
I consulted the Java documentation and hoped that specifying an alternative escape character might work, using the command
{escape '[char]'}
at the end of the SQL statement. However, I am still getting SQLException when I attempt to insert values containing consecutive escape characters. Is this standard JDBC behavior, or should I try to install a different JDBC driver?
Many thanks to anyone who tries to answer this, as I'm completely stuck!
Alex
<<Less