Labfans是一个针对大学生、工程师和科研工作者的技术社区。 | 论坛首页 | 联系我们(Contact Us) |
![]() |
![]() |
#1 |
初级会员
注册日期: 2010-03-30
年龄: 39
帖子: 8
声望力: 0 ![]() |
![]()
想构造一个数据库更改语句,:
update(conna,'testFeature',{'State'},{1},sqlStatement); 其中testFeature为表名,State为字段名,sqlStatement为查询条件,语句的目的是把符合条件的State字段值变为1。 sqlStatement是通过字符串拼接产生的,已知字符串变量:filename = ‘11.txt’ 用sqlStatement= ['where FeatureName = ',filename];报错,因为最后生成的结果是sqlStatement = ‘where FeatureName =11.txt’,而不是sqlStatement = ‘where FeatureName =‘11.txt’’ 请问怎样能生成sqlStatement = ‘where FeatureName =‘11.txt’’呢? ![]() |
![]() |
![]() |