<新手>Oracle的存储过程,编译正常,调用也正常,但就是没有结果输出,怎么回事???
--需求: 输入员工的编号,输出员工的工资,和部门编号
create or replace procedure pro_find_by_student
(
--输出参数, 员工编号, 接收传递过来的参数
p_s_id in student.s_id%type ,
--输出参数, 名字 返回输出的值
p_s_name out student.s_name%type ,
p_s_scor out student.s_scor%type
)
as
begin
--根据输入进来的编号, 返回姓名和工资
select s_name,s_scor into p_s_name,p_s_scor from student where s_id = p_s_id;
end;
--调用
declare
--必须声明变量接收输出的参数
v_s_name STUDENT.S_NAME%type;
v_s_scor STUDENT.S_SCOR%type;
begin
--调用存储过程
pro_find_by_student(12,v_s_name,v_s_scor);
--输出返回的值
DBMS_OUTPUT.PUT_LINE('姓名: '||v_s_name||', 成绩: '||v_s_scor);
end;