自定义函数报错,求修改

FUNCTION getDoTime_Fun(
  ids NUMBER, flags number)
  RETURN NUMBER
  IS
  V_sum NUMBER;
BEGIN
  if(ids is null) then
    V_sum := 0;
  else
      if(flags :=1) then
    select  DoTime into V_sum from MX_ServiceQuestion where id = ids;
   else
      if(flags :=2) then
    select  DoTime2 into V_sum from MX_ServiceQuestion where id = ids;
  else
    select  DoTime  into V_sum from MX_ServiceQuestion where id = ids;
        end if;
        end if;
        end if;
        
  RETURN V_sum;
    
END getDoTime_Fun;

我啥都不会 发布于 2021-1-8 19:23
1min目标场景问卷 立即参与
回答问题
悬赏:5 F币 + 添加悬赏
提示:增加悬赏、完善问题、追问等操作,可使您的问题被置顶,并向所有关注者发送通知
共1回答
最佳回答
0
我啥都不会Lv6初级互助
发布于2021-1-19 11:45

CREATE OR REPLACE
FUNCTION GETDOTIME_FUN (IDS  NUMBER, FLAGS  NUMBER)
RETURN NUMBER
AS
V_SUM NUMBER;
BEGIN
        if IDS is null then
        V_SUM:=0;
        ELSE IF FLAGS=2 THEN
        select  DoTime2 INTO V_SUM  from MX_ServiceQuestion WHERE id=IDS;
        ELSE
        select  DoTime INTO V_SUM  from MX_ServiceQuestion WHERE id=IDS;
    END IF;
    END IF;
    RETURN V_SUM;
END GETDOTIME_FUN;

  • 0关注人数
  • 358浏览人数
  • 最后回答于:2021-1-19 11:45
    请选择关闭问题的原因
    确定 取消
    返回顶部