oracle 存储过程 case when then

-- Created on 2017/5/12 by ADMINISTRATOR 
declare 
  -- Local variables here
  i integer;
  imonth int;
   updatestr        varchar2(50);
        daystr           varchar2(5);
begin
  imonth:=5;
  -- Test statements here
   case imonth
       when 1 then  daystr:=31; when 2 then daystr:=28;
       when 5 then daystr:=31; else daystr:=30;
       end case;
       dbms_output.put_line(daystr);
       end;

       

-------------------when 后面多个会报错,要end case-----------------

你可能感兴趣的:(oracle 存储过程 case when then)