set serverout on --使输出可以显示在屏幕上
declare
r_stu student%rowtype;
cursor c_stu is select * from student;
begin
open c_stu;
loop
fetch c_stu into r_stu;
exit when c_stu%notfound;
dbms_out.put_line('sname of sno' || r_stu.sno || 'is' || r_stu.sname); --
end loop;
close c_stu;
end;