All Forums Database
memostone 13 posts Joined 11/12
12 Dec 2012
numeric overflow occurrence

Hi, 
We are converting from Oracle to Teradata, and found some issues for DUAL table in Oracle doesn't exist in Teradata.
After research, dummy table was used, but when run below query, it gives error"Numeric overflow occurred during computation"

    SELECT 0 AS a from (select 'X' as DUMMY) as X 
   UNION ALL
    SELECT -9999 AS a from (select 'X' as DUMMY) as X 

Please suggest possible solutions. Thanks in advance!

ulrich 816 posts Joined 09/09
12 Dec 2012
SELECT cast(0 as integer) AS a from (select 'X' as DUMMY) as X
UNION ALL
 SELECT -9999 AS a from (select 'X' as DUMMY) as X

The first selects defines the datatype.
Try alsoe

 

SELECT type(0) AS a from (select 'X' as DUMMY) as X

 

 

feel free to donate bitcoin:12kgAUHFUqvG2sQgaRBXFhCwyf9HXdkGud

memostone 13 posts Joined 11/12
12 Dec 2012

It's working for both, thanks a lot ulrich. 

You must sign in to leave a comment.