setfilter引号问题
string ls_ksmc
long ll_row
string ls_atb
ll_row = dw_2.getrow()
ls_ksmc = dw_2.getitemstring(ll_row,'bmbm')
ls_a = "sb_mxb.bmbm = ls_ksmc"
dw_1.setfilter(ls_a)
dw_1.filter()
从dw_2中得到字段bmbm,通过bmbm检索dw_1的数据,结果报错“expression is not valid”怎么改setfilter的引号啊,各位高手指点
------解决方案--------------------------------------------------------ls_a
tb = "sb_mxb.bmbm = 'ls_ksmc'"
------解决方案--------------------------------------------------------应该是这样写:ls_a = "sb_mxb.bmbm = '"+ls_ksmc+"'"
------解决方案--------------------------------------------------------
------解决方案--------------------------------------------------------string ls_ksmc
long ll_row
string ls_a
ll_row = dw_2.getrow()
ls_ksmc = dw_2.getitemstring(ll_row,'bmbm')
ls_a = "sb_mxb_bmbm = '" + ls_ksmc + "'"
dw_1.setfilter(ls_a)
dw_1.filter()
------解决方案--------------------------------------------------------或者这样试试
string ls_ksmc
long ll_row
string ls_a
ll_row = dw_2.getrow()
ls_ksmc = dw_2.getitemstring(ll_row,'bmbm')
ls_a = "bmbm = '" + ls_ksmc + "'"
dw_1.setfilter(ls_a)
dw_1.filter()
------解决方案--------------------------------------------------------1.bmbm是不是字符型的,如不是请转成字符型,函数string()
2.dw_1有没有retrieve,没有retrieve就没有数据过滤了
------解决方案--------------------------------------------------------看下是不是引号写错了
------解决方案--------------------------------------------------------只要列的值不需要表的值看看
------解决方案--------------------------------------------------------要不然你不要带参数进去,直接就来个具体的值看看。
------解决方案--------------------------------------------------------dw_result.setfilter("bmbm = '"+ls_ksmc+"'")