第一种方式
-定义游标text_cursor 关联表t_icitem 基表
declare text_cursor cursor scroll
for select * from t_icitem 
--打开游标text_cursor
open text_cursor
--读取游标 第一行(first) 在text_cursor游标中
fetch first from text_cursor
--关闭游标text_cursor
close text_cursor
--释放(删除)游标,释放资源
deallocate text_cursor

第二种方式
declare @var_cursor  cursor  
set @var_cursor=cursor scroll for select * from t_icitem 
open @var_cursor
fetch last from @var_cursor
close @var_cursor
deallocate @var_cursor

 

相关文章:

  • 2022-12-23
  • 2021-06-14
  • 2021-08-06
  • 2022-12-23
  • 2022-12-23
  • 2021-12-19
  • 2022-12-23
  • 2021-12-13
猜你喜欢
  • 2021-06-02
  • 2021-08-17
  • 2021-11-16
  • 2022-01-04
  • 2022-12-23
  • 2022-12-23
  • 2021-09-04
相关资源
相似解决方案