Reputation: 1737
I am getting the "Invalid character constant" due to single quot in java sql string, i need double quote which i have put in single quote
new StringBuffer("SELECT REPLACE(u.nombre,',',' ') as Organizacion, ")
.append(" CONCAT(' " ',REPLACE(s.direccion,',',' '),'"') as Street, '""' as Street2,")
Upvotes: 5
Views: 1022
Reputation: 263683
You want to add "
in the string but the problem is you did not escape it causing to break the whole string.
You need to escape it using \
, ex.
" CONCAT('\"',REPLACE(s.direccion,',',' '),'\"') as Street, '\"\"' as Street2,"
Upvotes: 1
Reputation: 382092
You have to escape quotes in java string literals :
.append(" CONCAT('\"',REPLACE(s.direccion,',',' '),'\"') as Street, '\"\"' as Street2,")
Upvotes: 2