用plsql写存储过程的时候,遇到的几个错误,写的简单点,
1、---------------------
问题:
选项缺失或无效
原因:
我的sql开头 create or replace set_salary(ida int, sal int) as
少了 procedure
正确的应该是:
create or replace procedure set_salary(ida int, sal int) as
这个问题都是少了 procedure 造成的
2、---------------------
报错问题:实际返回的行数超出请求的行数
-- Created on 2019/8/6 by XIAOC
declare
-- Local variables here
i int;
stu_id student.id%type;
begin
-- Test statements here
for i in 1 .. 10 loop
dbms_output.put_line('当前i: ' || i);
select student.id into stu_id from student where student.id = i;
if stu_id is null then
insert into student (id) values (i);
commit;
end if;
end loop;
end;
报错的是这一行:select student.id into stu_id from student wh