How do I escape double quotes in a prepared statement in a java stored proc
606026Dec 18 2007 — edited Dec 20 2007It looks like the XMLElement is pretty touchy about it's first argument being in double quotes. This of course won't work:
String sql = "select XMLElement("CERT_CODE", cert_code)"+
" from cert_table"+
" where user_id='18592'";
PreparedStatement pstmt = conn.prepareStatement(sql);
""CERT_CODE"" wont compile: ORA-29536: badly formed source: Encountered "\"CERT_CODE\""
/"CERT_CODE/" wont compile: ORA-29536: badly formed source: Encountered "CERT_CODE"
' ' CERT_CODE' ' compiles, but runtime: OracleSQLException: ORA-00931: missing identifier
I've tried every other syntax I can think of and they all return the same.