/*谢谢大家帮助,我问这个问题主要是为了遍历树型结构,现已测试成功,
个人认为这是一种比较好的方法,速度很快,而且利用了在pb中for next 循环中循环
变量可以变化的特性,应该算是比较好的树型遍历方法了。不敢独享,拿出来供大家指点*/
long ll_row
nvo_dssaverow lds_unit//建立一个在retrievestart事件中return 2的datastore
lds_unit=create nvo_dssaverow
lds_unit.dataobject='d_unitlist'
lds_unit.settransobject(sqlca)
lds_unit.retrieve(-1)//父id为-1时表示从顶层开始检索
for ll_row=1 to lds_unit.rowcount()//遍历节点
lds_unit.retrieve(lds_unit.object.funitid[ll_row])//检索下级节点
next