student表里面有3条数据
sno sname pno
1 test 1
2 test2 2
3 test3 3
create or replace procedure stu_proc1(pno in student.sno%type) as
pname varchar2(25);
begin
select sname into pname from student where sno=pno;
dbms_output.put_line(pname);
end;然后调用存储过程:
call stu_proc1(2);
后会报说:实际返回的行数超出请求的行数
sno sname pno
1 test 1
2 test2 2
3 test3 3
create or replace procedure stu_proc1(pno in student.sno%type) as
pname varchar2(25);
begin
select sname into pname from student where sno=pno;
dbms_output.put_line(pname);
end;然后调用存储过程:
call stu_proc1(2);
后会报说:实际返回的行数超出请求的行数
stu_proc1(pno in student.sno%type)这个是啥意思啊
是不是pno这个参数的数据类型和大小和sno字段的一样?
pname varchar2(25);
begin
select sname into pname from student where sno=v_pno;
dbms_output.put_line(pname);
end;
这个参数和基表student中pno同名,引起错误。
for i in 10 loop
call stu_proc1(2);
end loop;这样就可以了!