0
この機能に関するヘルプが必要です。コードにはエラーはありませんが、2番目の条件/文の値と同じ結果が返され続けます。PL SQL Retirement function
これは、次のように動作すると考えられます。 従業員の雇用日(DOFA)が25歳以下の場合、雇用日は雇用日から35歳です。それ以外の場合、退職日は従業員の年齢が6
create or replace function EDOR_FUNCTION
(DOFA in date, DOB in date)
return date
is
new_edor_date date;
begin
if
DOFA - DOB <= 25 then new_edor_date := add_months(DOFA, 35*12);
else
new_edor_date := add_months(DOB, 60*12);
end if;
return new_edor_date;
end;
DOFAとDOBは日付型ですから、それらから年を抽出して減算する必要があります。年は「EXTRACT(YEAR FROM DOFA)」で抽出できます –
ありがとうございました。 – Auwal