DW中应用的初学者有关问题

DW中应用的菜鸟问题
例如:
表A 表B
column1 column2 column3 column4 columnA columnB columnC columnD


想实现tableA对应的DW_A每一行输入完换行以后检索数据库里的tableB
如果tableB里有一条数据的columnB,columnC分别与当前DW_A输入的column2,column3相同
则将columnD的值放入column4,请教该怎么做?

------解决方案--------------------
在DW_A的rowsfocuschanged事件中通过 DW_A的column2,column3来检索 tableB的数据
rowsfocuschanged事件代码:
string ls_column2_value, ls_column3_value ,ls_column4_value
ls_column2_value = this.getitemstring(row, "column2")
ls_column3_value = this.getitemstring(row, "column3")
select columnD
into:ls_column4_value
from tableB
where columnB = :ls_column2_value and columnC =:ls_column3_value;
if not isnull(ls_column4_value) and trim(ls_column4_value) <> '' then
this.setitem(row, "column4", ls_column4_value)
end if


------解决方案--------------------
探讨
在DW_A的rowsfocuschanged事件中通过 DW_A的column2,column3来检索 tableB的数据
rowsfocuschanged事件代码:
string ls_column2_value, ls_column3_value ,ls_column4_value
ls_column2_value = this.getitemstring(row, "column2")……