declare
cursor 游标名称
is
查询语句;
begin
--其他语句
end;
列子:
declare
cursor cur_stu
is
select name from student where id=2;
sname student.name%type;
result varchar2(20);
begin
open cur_stu;
loop
fetch cur_stu into sname;
exit when cur_stu%notfound;
result:=result||sname||'';
end loop;
dbms_output.put_line('我的名字叫' || result);
close cur_stu;
end;
定义游标
declarecursor 游标名称is查询语句;begin--其他语句end;列子:declarecursor cur_stuisselect name from student where id=2;sname student.name%type;result varchar2(20);beginopen c...
·
转载于:https://www.cnblogs.com/wush-2015/p/4618126.html
更多推荐




所有评论(0)