当前位置: 代码迷 >> PB >> PB基础应用,该如何解决
  详细解决方案

PB基础应用,该如何解决

热度:88   发布时间:2016-04-29 09:15:38.0
PB基础应用
分别拿dw中当前数据条目的A,B,C列同已声明的datastore中N条数据的E,F,G列的值比较
如果都相等匹配则dw.setitem(row,D,"H"),如何写?

------解决方案--------------------
假设所以列都是字符串型的:
C/C++ code
long ll_find, i, ll_rcll_rc = dw.rowcount()for i = 1 to ll_rc    ll_find = lds.find("E = '" + dw.getitemstring(i,'A') + "' and F = '" + dw.getitemstring(i,'B') + "' and G = '" + dw.getitemstring(i,'C') + "'",1, lds.rowcount())    if ll_find <= 0 then continue    //dw.setitem(i, 'D',"H")    dw.setitem(i, 'D',lds.getitemstring(ll_find, 'H'))next
------解决方案--------------------
long ll_find, i, ll_rc
string ls_data
ll_rc = dw.rowcount()
for i = 1 to ll_rc
ls_data = dw.getitemstring(i,'A')
ls_data += ',' + dw.getitemstring(i,'B')
ls_data += ',' + dw.getitemstring(i,'C')
ll_find = lds.find("E + ',' + F + ',' + G = '" + ls_data + "'",1, lds.rowcount())
if ll_find <= 0 then continue
dw.setitem(i, 'D',lds.getitemstring(ll_find, 'H'))
next
  相关解决方案