Home Page for the TeradataForum
 
https:

Archives of the TeradataForum

Message Posted: Wed, 27 Nov 2002 @ 18:29:46 GMT


     
  <Prev Next>   <<First <Prev Next> Last>>  


Subj:   Re: CHAR to INTEGER
 
From:   Michael Larkins

Mayur:

Since an integer can be slightly more than 2,000,000,000 you have to account for 10 digits (characters) + it can be a negative number. So, if a negative number is allowed in the domain for the column, that CHAR(11) is the maximum that you can allow.

However, when going from CHAR to INT, you probably need to make sure that your character number does not contain anything besides 0-9 and a sign. Additionally, it may not contain a number larger than the largest possible integer.

If you need a larger number, instead of converting to INT you will need to convert to DEC(?,0) where ? is the number of digits you need.

Side note, why are you building a table with the intention of converting? If you are going to need a numeric value, it makes no sense to store it in Teradata as a character. That's my 2 cents.


Hope this helps,

Mike



     
  <Prev Next>   <<First <Prev Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 28 Jun 2020