问题:postgreSQL insert 字段包含单引号,如:insert into table values('1001','tom'cat'),执行报错;
解决:将单引号替换为两个单引号,如 detail = detail.replace("'","''"),变为:insert into table values('1001','tom''cat')
参考:http://www.itpub.net/thread-780335-1-1.html
2022-10-17 22:38:53
问题:postgreSQL insert 字段包含单引号,如:insert into table values('1001','tom'cat'),执行报错;
解决:将单引号替换为两个单引号,如 detail = detail.replace("'","''"),变为:insert into table values('1001','tom''cat')
参考:http://www.itpub.net/thread-780335-1-1.html