PB帶引數帶結果集的動態SQL查詢

weixin_30588675發表於2020-04-05

 

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;//關閉遊標
//**********

 

轉載於:https://www.cnblogs.com/quietwalk/archive/2011/01/15/1936273.html

相關文章