Reputation: 13
This is a simple procedure and it generated a ORA -24344 compilation error and PLS - 00103. Please help in clearing them
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;
Upvotes: 0
Views: 157
Reputation: 123
You forgot then
after the condition :
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;
Upvotes: 1