How to escape single quote in sql which is causing' quoted string not properly terminated '? [duplicate] How to escape single quote in sql which is causing' quoted string not properly terminated '? [duplicate] oracle oracle

How to escape single quote in sql which is causing' quoted string not properly terminated '? [duplicate]


You can escape a single quote by repeating it:

term.replaceAll("'","''");

An even better option would be a parameterized query. For an example, we'd have to know your client language.