|
|
Archives of the TeradataForum
Message Posted: Sun, 20 Aug 2006 @ 10:34:47 GMT
Subj: | | Re: Teradata trailing spaces truncation in strings |
|
From: | | Anomy Anom |
<-- Anonymously Posted: Friday, August 18, 2006 15:42 -->
| I am observing trailing spaces truncation when converting data from oracle to teradata using utilities . | |
I believe Teradata truncates trailing spaces when you send data as CHAR but not VARCHAR. This is my understanding on how it works. So, you
might need to check how your load utility sending data. Below is an example.
:-)
--------------------------------------------------------------
show table test;
*** Text of DDL statement returned.
*** Total elapsed time was 1 second.
---------------------------------------------------------------
CREATE SET TABLE test ,NO FALLBACK ,
NO BEFORE JOURNAL,
NO AFTER JOURNAL,
CHECKSUM = DEFAULT
(
ch VARCHAR(10) CHARACTER SET LATIN NOT CASESPECIFIC)
PRIMARY INDEX ( ch );
BTEQ -- Enter your DBC/SQL request or BTEQ command:
delete test;
delete test;
*** Delete completed. No rows removed.
*** Total elapsed time was 1 second.
BTEQ -- Enter your DBC/SQL request or BTEQ command:
ins test(cast('abcd ' as char(10)));
ins test(cast('abcd ' as char(10)));
*** Insert completed. One row added.
*** Total elapsed time was 1 second.
BTEQ -- Enter your DBC/SQL request or BTEQ command:
sel '-'||ch||'-' from test;
sel '-'||ch||'-' from test;
*** Query completed. One row found. One column returned.
*** Total elapsed time was 1 second.
(('-'||ch)||'-')
----------------
-abcd-
BTEQ -- Enter your DBC/SQL request or BTEQ command:
delete test;
delete test;
*** Delete completed. One row removed.
*** Total elapsed time was 1 second.
BTEQ -- Enter your DBC/SQL request or BTEQ command:
ins test(cast('abcd ' as varchar(10)));
ins test(cast('abcd ' as varchar(10)));
*** Insert completed. One row added.
*** Total elapsed time was 1 second.
BTEQ -- Enter your DBC/SQL request or BTEQ command:
sel '-'||ch||'-' from test;
sel '-'||ch||'-' from test;
*** Query completed. One row found. One column returned.
*** Total elapsed time was 1 second.
(('-'||ch)||'-')
----------------
-abcd -
BTEQ -- Enter your DBC/SQL request or BTEQ command:
| |