主题: [MATLAB基础] Matlab字符串连接
查看单个帖子
旧 2011-11-13, 14:52   #1
faye135
初级会员
 
注册日期: 2010-03-30
年龄: 39
帖子: 8
声望力: 0
faye135 正向着好的方向发展
默认 Matlab字符串连接

想构造一个数据库更改语句,:
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’’呢?
faye135 当前离线   回复时引用此帖