if (v_flag = '1') then
if (to_number(substr(v_bmonth, 1, 4)) > 2008) then
v_KR := v_datedef * 2000;
elseif (to_number(substr(v_bmonth, 1, 4)) = 2008)
and(to_number(substr(v_bmonth, 5, 6)) > 2) then
v_KR := v_temp + 2000;
else
v_KR := v_datedef * 1600;
end if;
else
if ((to_number(substr(v_bmonth, 1, 4)) = 2008) and
(to_number(substr(v_bmonth, 5, 6)) > 2)) or
(to_number(substr(v_bmonth, 1, 4)) > 2008) then
v_templ := round((v_temp - v_datedef - 2000), 2);
if (v_templ > 0) then
v_KR := 0;
else
v_KR := abs(v_templ);
end if;
else
v_templ := round((v_temp - v_datedef - 1600), 2);
if (v_templ > 0) then
v_KR := 0;
else
v_KR := abs(v_templ);
end if;
end if;
end if;
|