ORA-01873: the leading precision of the interval is too small

select S.ENDDATE + interval '9999' day from transaction t;

 ORA-01873: the leading precision of the interval is too small

Cause:

When Passing Date time Interval with Precision > 2 raise this error since default scale is 2.

Solution:

Select:

select S.ENDDATE + interval '999' day(3) from transaction t;

Or

select S.ENDDATE + interval '9999' day(4) from transaction t;

 

Update:

update transaction t

set T.ENDDATE= T.ENDDATE +  interval '999' day(3)

where T.ID=100001;

Or

update transaction t

set T.ENDDATE= T.ENDDATE +  interval '9999' day(4)

where T.ID=100001;

Comments