发新话题
打印

游标编程套路

游标编程套路

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

TOP

发新话题