Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 29 Mar 2006 @ 14:55:19 GMT


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


Subj:   Re: Cast Operator
 
From:   Dieter Noeth

Sidharth Kunnath wrote:

  Why do these two queries yield different o/ps  


The maximum number of digits for an integer is 10 plus leading sign -> 11 chars.


  select employee_number (char(10)) from employee;  


This is an ANSI style CAST, it's left aligned with trailing blanks.


  select cast(employee_number as char(10)) from employee;  


This is a Teradata style CAST, it's right aligned with leading blanks.

Be aware of automatic typecasts, which are always Teradata style:

     select 1 || 1, position(1 in 1234567), position(2 in 123456789);

Dieter



     
  <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: 15 Jun 2023