Declare @dav as varchar(50) ---定义变量,用来保存从游标中取得的值Declare cursor5 cursor for select fl from table ---定义游标
open cursor5 ---打开游标fetch cursor5 into @pdav while @@fetch_status=0 ---循环读取值
begin
update table11 set .... where f1=@dav ---执行一定的操作
fetch cursor5 into @dav
endclose cursor5 ---关闭游标Deallocate Cursor5 ---删掉游标
open cursor5 ---打开游标fetch cursor5 into @pdav while @@fetch_status=0 ---循环读取值
begin
update table11 set .... where f1=@dav ---执行一定的操作
fetch cursor5 into @dav
endclose cursor5 ---关闭游标Deallocate Cursor5 ---删掉游标
{
xx = CallableStatementX.getResultSet();
while (xx.next())
{
System.out.println(xx.getInt(1));
}
} while (CallableStatementX.getMoreResults());