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;