PB中游標的使用

string ls_name
declare readdate cursor for select mc from bm where dwid='1';//建立遊標並賦值
open readdate;//打開遊標
fetch readdate into :ls_name;//從遊標中取值,每執行一次遊標就會讀取下一條數據
do while sqlca.sqlcode=0 //遍歷遊標
ddlb_1.additem(ls_name)
fetch readdate into :ls_name;
loop
close readdate;//關閉遊標sql

相關文章
相關標籤/搜索