Archives of the TeradataForum
Message Posted: Wed, 07 Mar 2012 @ 13:22:01 GMT
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
|