从学生表STUDENT(NAME,SEX,SORE)中
存储过程PRO_STU2
create or replace procedure senyi.pro_stu2(sex1 in number)
is
V_SUM varchar2(200);
cursor cur is select * from senyi.student where sex=sex1;
begin
for V_RESULT in cur loop
begin
V_SUM:=V_RESULT.NAME;
DBMS_OUTPUT.PUT_LINE(V_SUM);
END;
END LOOP;
END pro_stu2;
exec senyi.pro_stu2(1);
本文介绍了一个简单的PL/SQL存储过程实例,该过程用于从学生表中根据性别筛选并输出学生姓名。通过定义游标和循环遍历的方式实现了对学生表数据的检索。

被折叠的 条评论
为什么被折叠?



