SQL> create or replace procedure sp_pro7(goodsnum char) is
2 v_category goods.category%type;
3 begin
4 select category into v_category from goods where goodsid=goodsnum;
5 if v_category='家具' then
6 update goods set unitprice=unitprice-10 where goodsid=goodsnum;
7 elsif v_category='fruit' then
8 update goods set unitprice=(unitprice+1) where goodsid=goodsnum;
9 else
10 update goods set unitprice=(unitprice+100) where goodsid=goodsnum;
11 end if;
12 end;
阅读(1197) | 评论(0) | 转发(0) |