Quantcast
Channel: Java mon amour
Viewing all articles
Browse latest Browse all 1121

ORA-00932: inconsistent datatypes: expected NUMBER got INTERVAL DAY TO SECOND

$
0
0
It looks like you are trying to do maths (+, -) with TIMESTAMP.

If you try to sum or subtract two timestamps, you will get:

ORA-00932: inconsistent datatypes: expected NUMBER got INTERVAL DAY TO SECOND


TIMESTAMP doesn't like that. you should CAST the TIMESTAMP to DATE:

rather than
bla - blu (where bla and blu are TIMESTAMP)
do
CAST (bla as DATE) - CAST (blu as DATE)

and you will get a NUMBER (multiply it by 3600 * 24 and you will turn it into seconds)

BUT
you will lose the millisecond info


Here you have the definition of the TIMESTAMP




Viewing all articles
Browse latest Browse all 1121

Trending Articles