Can we escape but quotes and delimiter in data while exporting TPT scripts

Tools & Utilities
Enthusiast

Can we escape but quotes and delimiter in data while exporting TPT scripts

We are exporting data from Teradata using TPT using '|' as delimiter and double quotes(") as enclosure.The data has both doublequotes as well as '|' in the data.Can we escape both quotes as delimiters in the TPT export script?

6 REPLIES
Teradata Employee

Re: Can we escape but quotes and delimiter in data while exporting TPT scripts

Check out "EscapeTextDelimiter" and "EscapeQuoteDelimiter" in the TPT Reference Manual.

 

-- SteveF
Enthusiast

Re: Can we escape but quotes and delimiter in data while exporting TPT scripts

Hi,
We have used both the options in the dataconnector operator as shown below:

VARCHAR OpenQuoteMark = '"',
VARCHAR CloseQuoteMark = '"',
VARCHAR TextDelimiter = '|',
VARCHAR QuotedData='Yes',
VARCHAR EscapeQuotecharacter='\'
VARCHAR EscapeTextDelimiter='*'

The quotes are coming properly and the quotes in data are escaped properly. But the delimiters character '|' when present in the data are not escaped.Does it have any version dependency on TD or TPT version?
Teradata Employee

Re: Can we escape but quotes and delimiter in data while exporting TPT scripts

Can you please provide a sample row that is failing?

What version of TPT are you running?

 

-- SteveF
Teradata Employee

Re: Can we escape but quotes and delimiter in data while exporting TPT scripts

If all the fields are quoted, why do you need to escape the delimiter (inside the quotes)?

Teradata Employee

Re: Can we escape but quotes and delimiter in data while exporting TPT scripts

Should not have to.

That is why I asked for a sample row that is failing, and the version of TPT, in case we had a bug that was fixed.

 

-- SteveF
Enthusiast

Re: Can we escape but quotes and delimiter in data while exporting TPT scripts

We need to compare the TPT exported file with another exported file from another database and compare field by field through a downstream application.So we need common delimiters and enclosure in both exported files.We have both quotes(") and the delimiter(|) in the data so we need to escape both
Sample row
Id. Field
Fe12. In"dr|a"nilroy
Sample exported record
"Fe12"|"In\"dr|a\"nilroy"

As you can see quoted in data are escaped but delimiter inside data is not escaped.But both quotes as well as delimiters are escaped in target system.
TPT version 15.00

Teradata Version:13.00