문제

In the docs, I found the function TIMESTAMPADD.

I'm trying to to this:

insert into status(identifier, firstoccurrence) values('foo', 
    timestampadd(SQL_TSI_SECOND, 1389995576, TIMESTAMP '1970-01-01 00:00:00'));

But I got this error:

data exception: interval field overflow / Error Code: -3435 / State: 22015

It seems like there is a problem with the epoch value 1389995576.

The problem is I can't use a bigger time unit, such as day or month, to then divide this constant value because theese are pricise data.

Are there any other ways of doing this?

도움이 되었습니까?

해결책

Try the direct conversion function:

insert into status(identifier, firstoccurrence) values('foo', 
    timestamp(1389995576));

The TIMESTAMPADD function will be extended in future versions to accept large values

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top