Oracle 存储过程不能执行 但是不报错
一张学生表student一张成绩表gradecreateorreplaceproceduredel_stu(studentID1innumber)isbegindelet...
一张学生表student 一张成绩表grade
create or replace procedure del_stu
(studentID1 in number)
is
begin
delete from student where studentid=studentID1;
if SQL%ROWCOUNT = 0 then
RAISE_APPLICATION_ERROR(-20123, 'Invald product code', TRUE);
end if;
delete from grade where studentid=studentID1;
if SQL%ROWCOUNT = 0 then
RAISE_APPLICATION_ERROR(-20123, 'Invald product code', TRUE);
end if;
commit;
exception when others then
rollback;
end;
call del_stu(1);
为什么不能执行,但是不报错,两张表都有studentID=1的学生 展开
create or replace procedure del_stu
(studentID1 in number)
is
begin
delete from student where studentid=studentID1;
if SQL%ROWCOUNT = 0 then
RAISE_APPLICATION_ERROR(-20123, 'Invald product code', TRUE);
end if;
delete from grade where studentid=studentID1;
if SQL%ROWCOUNT = 0 then
RAISE_APPLICATION_ERROR(-20123, 'Invald product code', TRUE);
end if;
commit;
exception when others then
rollback;
end;
call del_stu(1);
为什么不能执行,但是不报错,两张表都有studentID=1的学生 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询