I don't understand why to_yminterval('01-02') doesn't work and to_yminterval('03-03') does with my data?
SQL> select ename, hiredate, hiredate + to_yminterval('01-02') from emp
ERROR:
ORA-01839: date not valid for month specified
no rows selected
SQL> c/01-02/03-03
1* select ename, hiredate, hiredate + to_yminterval('03-03') from em
SQL> /
ENAME HIREDATE HIREDATE+TO_YMIN
---------- ---------------- ----------------
SMITH 12.17.1980 00:00 03.17.1984 00:00
ALLEN 02.20.1981 00:00 05.20.1984 00:00
WARD 02.22.1981 00:00 05.22.1984 00:00
JONES 04.02.1981 00:00 07.02.1984 00:00
MARTIN 09.28.1981 00:00 12.28.1984 00:00
BLAKE 05.01.1981 00:00 08.01.1984 00:00
.
.
.
select to_date('30-Jan-1987','dd-
19:41:12 Processing ...
19:41:12 select to_date('30-Jan-1987','dd-
19:41:12 *
19:41:12 ORA-01839: date not valid for month specified
select to_date('30-Jan-1987','dd-
30-Mar-1988
as you see, to_date('30-Jan-1987','dd-
so, Oracle does not handle this well when you date in February and the date has more than 29 days.