我开发了一个 java 应用程序,用于读取给定的 xml 文件并SQL INSERT or UPDATE statements
使用 xml 文件中的数据进行制作。有趣的是,有一些陈述如下。
INSERT INTO BUYERS(BUYER_ID, BUYER_NAME) VALUES ('100', 'A's Shop')
INSERT INTO BUYERS(BUYER_ID, BUYER_NAME) VALUES ('101', 'ABC's Shop')
INSERT INTO BUYERS(BUYER_ID, BUYER_NAME) VALUES ('102', 'ZXCVBN's Shop')
INSERT INTO BUYERS(BUYER_ID, BUYER_NAME) VALUES ('103', 'RR's Shop')
UPDATE BUYERS SET BUYER_NAME = 'MKO's Shop' WHERE BUYER_ID = 151
UPDATE BUYERS SET BUYER_NAME = 'DDD's Shop' WHERE BUYER_ID = 160
当我尝试执行这些语句时,我得到一个错误,ORA-00917: missing comma
因为有一个single quote
in 值BUYER_NAME
。
我试图single quote
用replace(char oldChar, char newChar)
java中的方法替换这个。但它替换single quotes
了我的查询中的所有内容。
我只需要替换single quote
with BUYER_NAME
。我怎么能这样做?