查看完整版本: 游标编程套路

ljw9128 2006-12-13 09:09

游标编程套路

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;
转载 文章来自[url=http://www.study01job.com/pb]http://www.study01job.com/pb[/url]

zhouln2008 2007-9-17 09:51

顶了!!!!!!!!!!!!!!!!!!!!!
页: [1]
查看完整版本: 游标编程套路