MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   MATLAB论坛 (https://www.labfans.com/bbs/forumdisplay.php?f=6)
-   -   [MATLAB基础] Matlab字符串连接 (https://www.labfans.com/bbs/showthread.php?t=14052)

faye135 2011-11-13 14:52

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 2011-11-13 16:13

回复: Matlab字符串连接
 
怎么没人给我回复?
没关系,这个问题我已经解决了,通过别的字段访问数据库改值,但是希望有高人给指点一下,用字符串变量怎么做


所有时间均为北京时间。现在的时间是 11:28

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.