游标的使用

declare
cur_book readerinfo%rowtype;
begin
select * into cur_book from readerinfo where readerid=9701;

if sql%isopen then
dbms_output.put_line ('isopen属性为true');
else
dbms_output.put_line ('isopen属性为false');
end if;

if sql%found then
dbms_output.put_line('%found为true');
end if;
update readerinfo set sex ='nv' where sex='男';
dbms_output.put_line('修改脚本记录数:' || sql%rowcount);
rollback;
exception ---异常处理部分
when no_data_found then
dbms_output.put_line(sql%rowcount);
end;

posted @ 2016-06-15 20:46  小草吹又生  阅读(118)  评论(0编辑  收藏  举报