利用游标修改、删除数据
2018-03-30 14:56
225 查看
declare auth_cur cursor scroll for
select au_id, au_lname, au_fname, state
from authors for update of au_lname
open auth_cur
declare @rowcount int
set @rowcount = 6
fetch absolute @rowcount from auth_cur --将变量@rowcount标识的行设置为当前行
--下面1行是利用游标进行修改操作
update authors set au_lname='张' where current of auth_cur --修改游标中的当前行
--下面1行是利用游标进行删除操作
delete from authors where current of auth_cur
相关文章推荐
- 利用Jquery+HTML静态模版实现数据的展示及无刷新增加,修改,删除,分页操作!
- 项目经验之:利用Jquery+HTML静态模版实现数据的展示及无刷新增加,修改,删除,分页操作!!!
- 利用EXCEL将多列多行数据转换为SQL语句【新增、删除、修改同理】
- 循环逐条修改或者删除数据(游标)
- 利用隐式游标分批删除数据的procedure
- 利用DataGridView增加,修改,删除数据
- 使用游标实现循环,修改数据,删除数据
- 基本查询语句及利用SQL语句完成数据的添加、删除、修改操作
- 利用二叉查找树处理数据-加载、存储、插入、删除、修改、输出
- Oracle 使用游标修改或删除数据
- 二十一、Mysql 插入, 修改, 删除数据
- JAVA修改、删除数据之后刷新JTable的方法
- 利用DataGrid编辑、修改、删除记录
- DataSet SqlCommandBuilder添加修改删除数据
- SQL 利用游标循环添加数据
- ThinkPHP 修改,删除数据,全部显示
- 利用django中redisco库,修改redis模型导致数据无法保存以及部分其他问题
- 如何解决使用addBatch()和executeBatch()无法批量增加删除修改数据库数据等问题
- 数据的增删改查:数据的添加,修改和删除与事务
- 利用Access实现Excel中多表合并,并删除重复数据的问题