oracle function 返回值不显示
createorreplacefunctionWF_CalcIcon(StartTimeINDATE,CloseTimeINDATE,AdderINNUMBER,Stat...
create or replace function WF_CalcIcon(
StartTime IN DATE,
CloseTime IN DATE,
Adder IN NUMBER,
State IN NUMBER,
Timer IN FLOAT,
Alert IN FLOAT)
return NUMBER
IS
dt float;
begin
IF State > 1 then dt := Adder ;
ELSE
SELECT ( CASE WHEN Wk_Start > StartTime AND Wk_Close > CloseTime THEN CAST( CloseTime - Wk_Start AS FLOAT )
WHEN Wk_Start > StartTime AND Wk_Close < CloseTime THEN CAST( Wk_Close - Wk_Start AS FLOAT )
WHEN Wk_Close < CloseTime THEN CAST( Wk_Close - StartTime AS FLOAT )
ELSE CAST( CloseTime - StartTime AS FLOAT ) END ) into dt
FROM Sys_WkTime WHERE Wk_Start < CloseTime AND Wk_Close > StartTime;
dt := dt * 24.0 + Adder;
END IF;
IF dt > Timer then RETURN 2;
ELSIF dt > Alert then RETURN 1;
ELSE RETURN 0;
END IF;
end WF_CalcIcon;
求高手 展开
StartTime IN DATE,
CloseTime IN DATE,
Adder IN NUMBER,
State IN NUMBER,
Timer IN FLOAT,
Alert IN FLOAT)
return NUMBER
IS
dt float;
begin
IF State > 1 then dt := Adder ;
ELSE
SELECT ( CASE WHEN Wk_Start > StartTime AND Wk_Close > CloseTime THEN CAST( CloseTime - Wk_Start AS FLOAT )
WHEN Wk_Start > StartTime AND Wk_Close < CloseTime THEN CAST( Wk_Close - Wk_Start AS FLOAT )
WHEN Wk_Close < CloseTime THEN CAST( Wk_Close - StartTime AS FLOAT )
ELSE CAST( CloseTime - StartTime AS FLOAT ) END ) into dt
FROM Sys_WkTime WHERE Wk_Start < CloseTime AND Wk_Close > StartTime;
dt := dt * 24.0 + Adder;
END IF;
IF dt > Timer then RETURN 2;
ELSIF dt > Alert then RETURN 1;
ELSE RETURN 0;
END IF;
end WF_CalcIcon;
求高手 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询