Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 19 Mar 2008 @ 20:23:17 GMT


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


Subj:   Re: Comparing blanks and Nulls
 
From:   Michael Larkins

Anomy.Anom:

You wrote:

  You say "blank (non-null, non-spaces)" but there is no such thing. Teradata trims trailing spaces from VARCHAR fields and pads CHAR fields with trailing spaces.  


This is a common misconception. Teradata will store whatever you give it in a varchar column.

     ct vartbl (varcol varchar(15));
     ins vartbl ('');
     ins vartbl ('a ');
     ins vartbl (b');
     ins vartbl (trim('c     '));
     sel varcol, char(varcol) from vartbl order by 2;

     varcol   Characters(varcol)
                    0
       b            1
       c            1
       a            2

Hope this helps clear up your confusion.


Michael Larkins
Certified Teradata Master
Certified Teradata SQL Instructor



     
  <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: 27 Dec 2016