SQL>
SQL> CREATE OR REPLACE FUNCTION is_overdue (due_date IN DATE,paid_date IN DATE)
2 RETURN BOOLEAN
3 IS
4 days_between NUMBER (2) := due_date - paid_date;
5 BEGIN
6 RETURN days_between > 30;
7 EXCEPTION
8 WHEN OTHERS
9 THEN
10 DBMS_OUTPUT.put_line ('Error in is_overdue; Check input data.');
11 END;
12 /
Function created.
SQL>