这是一个简单的过程,它生成了ORA -24344编译错误和PLS - 00103.请帮助清除它们
create or replace PROCEDURE test (v_price in number)
IS
BEGIN
if ROWNUM = 0
insert into admin (price) values (v_price);
else
update admin set price = v_price;
end if;
END;
答案 0 :(得分:1)
在条件之后忘了then
:
create or replace PROCEDURE test (v_price in number) IS
rn number;
BEGIN
select count(*) into rn from admin;
if rn = 0 THEN
insert into admin (price) values (v_price);
else
update admin set price = v_price;
end if;
END;