  |  
  |  
 
Archives of the TeradataForum 
 
 
Message Posted: Fri, 26 Oct 2012 @ 17:16:51 GMT 
 
  
 
 
 
 
  
|  Subj:  |   |  Re: Numeric overflow while doing UNION  |   
|     |   
|  From:  |   |  Myrna, James  |   
  
 
 
  
Suresh, 
I have seen in the past, that when you do a UNION of 2 SQL statements, the data type for the resulting column is based on the columns in the
first SELECT statement. So if your first SQL is selecting a SMALLINT and your second query is selecting a BIGINT, the result column may be a
SMALLINT and the value from the BIGINT won't fit into it. Try switching the order of the two queries or CAST the numeric columns to larger
values. 
 Jim 
 
 
 
 
   
 
 |   |