输入参数为课程号SN,返回本门课程的学号,姓名,课程号,分数
结果集。 答案参考课件
一、 建包
Create package 包名 as Type 游标名 is ref cursor; End; 二、 建存储过程
Create 过程名(游标参数名 out包名. 游标名) as
Begin Open游标参数名 for select * from xxxx; end;
三、通过块调用存储过程
Declare 四个变量声明
游标参数名 out包名. 游标名; Begin
过程名; Loop Fetch游标参数名 into 四个变量; Exit when游标参数名%notfound; 输出记录; End loop; end