Home Page for the TeradataForum
 
https:

Archives of the TeradataForum

Message Posted: Wed, 07 Mar 2012 @ 13:22:01 GMT


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


Subj:   Re: Like keyword issues with %
 
From:   Dieter Noeth

The datatype of dbc.Tabes.TableName is a CHAR(30), a comparison with "tablename = 'HI_WORLD'" results in

     "'HI_WORLD                      ' = 'HI_WORLD'"

and the shorter string is padded with blanks for comparison.

But LIKE never add pad characters, thus your comparison translates to

     "'HI_WORLD                      ' LIKE '%WORLD', which is FALSE.

Add a TRIM(TableName) or switch to dbc.TablesV which defines TableName as VARCHAR.


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: 28 Jun 2020