Home Page for the TeradataForum
 
 

 

Archives of the TeradataForum





Message Posted: Fri, 04 Aug 2006 @ 20:47:23 GMT





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




Subj:   Re: Missbehaving char/varchar data in teradata sql assistent
 
From:   Anomy Anom



<-- Anonymously Posted: Friday, August 04, 2006 16:44 -->

It's always a question for me too, why it's the case even with VARCHAR. I know what happens with CHAR(N), fine. But see below.

     ---------
     ct test(ch varchar(10));

     ct test(ch varchar(10));

      *** Table has been created.
      *** Total elapsed time was 1 second.


      BTEQ -- Enter your DBC/SQL request or BTEQ command:
     ins test('abc');

     ins test('abc');

      *** Insert completed. One row added.
      *** Total elapsed time was 1 second.


      BTEQ -- Enter your DBC/SQL request or BTEQ command:
     sel * from test where ch = 'abc   ';

     sel * from test where ch = 'abc   ';

      *** Query completed. One row found. One column returned.
      *** Total elapsed time was 1 second.

     ch
     ----------
     abc

      BTEQ -- Enter your DBC/SQL request or BTEQ command:
     sel '-'||ch||'-' from test where ch = 'abc   ';

     sel '-'||ch||'-' from test where ch = 'abc   ';

      *** Query completed. One row found. One column returned.
      *** Total elapsed time was 1 second.

     (('-'||ch)||'-')
     ----------------
     -abc-




     
  <Prev Next>   <<First <Prev Next> Last>>  
 
 
 
 
 
 
 
 
  
 
  Top Home Join Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky 
Last Modified: 30 Jun 2008