Special characters added with TRIM

General
General covers Articles, Reference documentation, FAQs, Downloads and Blogs that do not belong to a specific subject area. General-purpose Articles about everything and anything
Enthusiast

Special characters added with TRIM

Hi,
I am using fast export to create a file , when I CAST all the columns as CHAR then there is no issue but when I add TRIM to remove any space for all the columns then there are some special characters added in beginning of first column.
SELECT
CAST ( TRIM (
CAST (COL1 as char(10)) ||
CAST (COL2 as char(10))
AS CHAR (60)))

I am adding TRIM to remove any unused space .

Please suggest.
1 REPLY
Highlighted
Teradata Employee

Re: Special characters added with TRIM

TRIM makes the value VARCHAR so the first two bytes of the output are a binary length field. 

You could write an OUTMOD to remove those two bytes, or use some utility to strip them from the file after the EXPORT completes.

 

Or just use TPT instead of FastExport, and specify that the output should be "Delimited".