SQL>
SQL> DECLARE
2 start_date DATE;
3 end_date DATE;
4 service_interval INTERVAL YEAR TO MONTH;
5 years_of_service NUMBER;
6 months_of_service NUMBER;
7 BEGIN
8 service_interval := (end_date - start_date) YEAR TO MONTH;
9 DBMS_OUTPUT.PUT_LINE(service_interval);
10
11 END;
12 /
PL/SQL procedure successfully completed.
|