pl/sql 条件语句多重用法!

1235阅读 0评论2012-12-30 古丁高手
分类:Oracle

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;
上一篇:编写一个简单的oracle存储过程(条件语句)程案例!(初学者)
下一篇:c语言中有关负数的存储