Is it possible and is it good solution create computed column where use function to calculate value?
eg.
table_1
id type date_from date_to TOTAL_CURRENT_YEAR (computed column)
-------------------------------------------------------------------
1 A 01.01.2022 01.05.2022 if type = A call function to calculate TOTAL_CURRENT_YEAR => Select f_calculate_A(date_from,nvl(check_out,sysdate)) from dual)
2 B 01.01.2022 01.05.2022 if type = B call function to calculate TOTAL_CURRENT_YEAR => Select f_calculate_B(date_from,nvl(check_out,sysdate)) from dual)
How define TOTAL_CURRENT_YEAR (computed column)?
Alter table table_1 add TOTAL_CURRENT_YEAR.........