--使用游标
declare
stu_name varchar2(20);
stu_score integer;
--定义游标
cursor cursor_student is
select stuname,stuscore from student where stuid = 88;
begin
--打开游标
open cursor_student;
--提取游标数据
fetch cursor_student into stu_name,stu_score;
if cursor_student%isopen then
dbms_output.put_line('游标已经打开!');
end if;
if cursor_student%found then
dbms_output.put_line('游标中包含数据!');
end if;
if cursor_student%notfound then
dbms_output.put_line('游标中不包含数据!');
end if;
dbms_output.put_line('游标的行数:'||cursor_student%rowcount);
--关闭游标
close cursor_student;
end;