Casting datetime calculation to interval problem
Posted in 2007
Topics: Installation, Setup & Upgrades, Server Administration, Licensing & Editions, Platform-Specific Issues
Hi guys
IDS9.30HC5 on HP-UX 11i
See my sig regarding the old version we're using here ;)
Got an odd thing here under dbaccess:
select (current - lastupd)::interval hour to
hour
from parameters where prmtrsid_ref = 716
where CURRENT, for example, is 2007-05-03 12:47:36.000 and lastupd
(defined as DATETIME YEAR TO SECOND) is 2007-04-27 11:00:00
Running it returns error 1265, Overflow occurred on a datetime or
interval operation.
I find that if the difference is more than 97 hours, this error occurs
- weird or what?
The finderr states:
Both DATETIME and INTERVAL values are stored internally as
DECIMAL
values. In this statement, an arithmetic operation that uses
DATETIME
and/or INTERVAL values has caused an arithmetic overflow.
This
situation should not occur. Check the precision that is specified
for
an INTERVAL value. If the INTERVAL value that you want to enter
is
greater than the default number of digits that are allowed for
that
field, you must explicitly identify the number of significant digits
in
your definition. If the error recurs, please note all circumstances
and
contact Informix Technical Support.
Can anyone throw any light on this?
Cheers
Malc
Don't ask me about management strategy re. deciding whether to upgrade
or deciding not to relicense the existing obsolete and unsupported
installation due to the code testing costs involved, because "we
haven't placed a support call in 5 years". No seriously.
It's ok, I just RTFM (last resort) and of course I needed to specify the size of the hour interval because it defaults to a 2-digit number - Doh! So the query is now blahblahblah::INTERVAL HOUR(4) to HOUR Sorry to trouble you all, I'll go away now........ Malc