注册 登录
编程论坛 PowerBuilder

[转载]游标编程套路

dtx 发布于 2006-12-13 09:11, 673 次点击


String ls_temp1
String ls_temp2

declare cur_name CURSOR FOR
select field1,field2 from tablename
where condition
OPEN cur_name;

FETCH cur_name INTO :ls_temp1,:ls_temp2;
do while sqlca.sqlcode = 0
//其它处理语句,尽量不要包含SQL语句。如果要包含,一定要在fetch语句之前。
FETCH cur_dis INTO :ls_temp1,:ls_temp2;
loop

close cur_name;
转载 文章来自http://www.study01job.com/pb


1 回复
#2
dream_hai2006-12-19 20:55

这个例子不全吧?

1