numeric overflow occurrence

Database
Enthusiast

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!

2 REPLIES
Senior Supporter

Re: numeric overflow occurrence

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

 

Enthusiast

Re: numeric overflow occurrence

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