|
本帖最后由 Qter 于 2021-4-15 13:49 编辑
- 查询带双引号的要用两个双引号--外面是双引号
- SELECT * from Config where funcValue like "%""%"
- 查询带单引号的--外面是双引号
- SELECT * from Config where funcValue like "%'%"
- arg查询要带\"
- sql = QString("SELECT lsid FROM SyncFile WHERE name=\"%1\"").arg(cf->getname());
-
-
- sqlite语句里出现的字符串就得做自己做replace("'","''")处理
- INSERT INTO Config(accountId,funcKey,funcValue) VALUES(1,2,'5 O''clock');
-
- INSERT INTO Config(accountId,funcKey,funcValue) VALUES(1,2,"6 O''clock");
-
- INSERT INTO Config(accountId,funcKey,funcValue) VALUES(1,2,"7 O""clock");
-
- INSERT INTO Config(accountId,funcKey,funcValue) VALUES(1,2,'8 O""clock');
复制代码 sql = QString("INSERT INTO SyncFile ( name) VALUES (?);");
query.prepare(sql);
query.addBindValue(TypeFolder->getname());
query.blockExec();
|
|