看看我写的程序包那里错了
表my_toysid varchar2(5)
name varchar2(20)
price number
create or replace package body toyspack
as
procedure UpdateToyPrice IS
avg_price number;
fact_price number;
begin
loop
SELECT AVG(price),price INTO avg_price,fact_price FROM my_toys;
if avg_price<400 then
update my_toys set price=price*1.1 where price<=500;
else
exit;
end if;
end loop;
end UpdateToyPrice; ----------------过程结束
function AvgToyPrice ----------------函数开始
return varchar2
IS
avg_price number;
fact_price number;
begin
loop
SELECT AVG(price),price INTO avg_price,fact_price FROM my_toys;
if avg_price<400 then
update my_toys set price=price*1.1 where price<=500;
else
return '函数执行完成!';
end if;
end loop;
end AvgToyPrice;
end toyspack;
/