| |
21. 8. 7. Add 1 year, 2 months, 3 days, 4 hours, 5 minutes, 6.7 seconds |
|
SQL>
SQL> DECLARE
2 hire_date TIMESTAMP WITH TIME ZONE;
3
4 a INTERVAL YEAR TO MONTH;
5 b INTERVAL DAY TO SECOND;
6 BEGIN
7 hire_date := TIMESTAMP '2000-09-01 00:00:00 -5:00';
8 DBMS_OUTPUT.PUT_LINE(hire_date);
9
10 a := INTERVAL '1-2' YEAR TO MONTH;
11 b := INTERVAL '3 4:5:6.7' DAY TO SECOND;
12
13
14 hire_date := hire_date + a + b + 36/24;
15 DBMS_OUTPUT.PUT_LINE(hire_date);
16
17
18 END;
19 /
PL/SQL procedure successfully completed.
SQL>
SQL>
SQL>
SQL>
|
|
|