PB带参数带结果集的动态SQL查询
时间:2011-01-15 来源:quietwalk
strSelectedDepartment=Trim(parent.cb_department.text)
string strSelectedDepartmentCode
//************
string strSQL
strSQL="select bmbh from pub_bm where bmmc= ?"
declare cr dynamic cursor for SQLSA;
prepare SQLSA from :strSQL;
open dynamic cr using :strSelectedDepartment;
Label:
fetch cr into :strSelectedDepartmentCode;
if SQLCA.SQLCode=0 then//如果成功取出记录
//进行相应处理
goto Label//取下一条
end if
close cr;//关闭游标
//**********
相关阅读 更多 +