ITPub博客

首页 > Linux操作系统 > Linux操作系统 > oracle plsql case when_end case小记

oracle plsql case when_end case小记

原创 Linux操作系统 作者:wisdomone1 时间:2012-11-30 16:49:37 0 删除 编辑
create or replace function func_1_2_mv_orderstatus(in_orderbill_status in portal_orderbill.orderbill_status%type)
/* 过程、函数简要描述信息
  **********************************************************
  *  函数名  : func_1_2_mv_orderstatus
  *  建立日期      : 2012-11-30
  *  作者              : 
  *  模块              : 
  *  功能描述      :
  *  输入参数      :
  *                 
  *
  *  输出参数      :
  *  源表:       
  *  目标表:     
  *  备注:                      :
  *------------------------------------------------------------
  *  修改历史
  *  序号    日期             修改人      修改原因
  *  1       2012-11-30              创建
                                  
  ************************************************************ */
return  integer
is
  v_result integer;
begin
 --一期订单 订单状态  
/*  订单状态:0关闭,1支付成功2未支付3支付失败,4已下发
,5计费成功,6计费失败,7待审核,8审核驳回,9审核通过
,10退款已受理,11退款成功,101已经预约,102等待通知,103待(收货)付款
,55充值中,111充值请求成功,222充值请求失败,
555充值请求中*/
--二期增值业务订单 订单状态
/*订单状态:0初始状态,1成功,2失败
见字典表s_dic.dic_type='BILL_STATUS'*/
                          
          case
                when in_orderbill_status='1'       then v_result:=1;
                when in_orderbill_status='2'       then v_result:=0;
                when in_orderbill_status='4'       then v_result:=0;
                when in_orderbill_status='5'       then v_result:=1;
                when in_orderbill_status='6'       then v_result:=2;
                when in_orderbill_status='7'       then v_result:=0;
                when in_orderbill_status='8'       then v_result:=2;
                when in_orderbill_status='9'       then v_result:=1;
                when in_orderbill_status='10'      then v_result:=2;
                when in_orderbill_status='103'     then v_result:=0;
                when in_orderbill_status='111'     then v_result:=1;
                when in_orderbill_status='222'     then v_result:=2;
                when in_orderbill_status='500'     then v_result:=0;
                when in_orderbill_status='501'     then v_result:=0;
                when in_orderbill_status='502'     then v_result:=0;
                when in_orderbill_status='505'     then v_result:=0;
                when in_orderbill_status='555'     then v_result:=0;
                when in_orderbill_status='601'     then v_result:=0;
        end case;
return v_result;
end func_1_2_mv_orderstatus;

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/9240380/viewspace-750342/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
提供针对oracle初学者及进阶的数据库培训,欢迎大家咨询: 微信: wisdomone 微信公众号: lovedb 工作经历: 中国普天 北京科蓝 北京云和恩墨 北京神州新桥

注册时间:2008-04-04

  • 博文量
    2189
  • 访问量
    12690138