| Archives of the TeradataForumMessage Posted: Wed, 19 Mar 2008 @ 20:23:17 GMT
 
 
  
| 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 LarkinsCertified Teradata Master
 Certified Teradata SQL Instructor
 
 
 |