All Forums Tools
abhipsa_beuria 2 posts Joined 03/14
19 Jul 2014
Issues with TPT when escape character comes in the data

Hello,
I am using TPT to export data. I am using delimiter as |  and escapetextdelimiter as \ . Also I have arequirement to replace \ with \\ when \ comes in data. So I tried using oreplace function in my view. After using that any row which has \ in the data the next delimiters got missed.
 
Example:
if there is no \ in the data this is how my export looks like which is correct
ABC |123 |456 |789
if \ comes in the data e.g ABC\ and in the view i use oreplce to make it ABC\\.
Now when I export using TPT from that OREPLACE view, this is what I am getting in the export file.
ABC\\ 123 456 789
Can anyone tell me how this could be resolved.
 
Thanks

feinholz 1234 posts Joined 05/08
21 Jul 2014

Please provide the script.
What version of TPT are you using?
What operator are you using for the export?

--SteveF

abhipsa_beuria 2 posts Joined 03/14
21 Jul 2014

Hello,
 
We are using Teradata Parallel Transporter Version 13.10.00.05
Script:
 tbuild -r /xxx/xxx/xxx/xx/xxxx -f /xxx/xxx/xxx/xx/xxxx/file1.ctl -u " v_outfile='file.out',v_exportqry='lock row for access select * from dbname.viewname ;',v_directorypath='/xxx/xxx/xxx/xx/xxxx',v_delimiter_value='|',v_utf='UTF8', TraceLevel='ALL', v_sessions=8,v_src_object=schema_SCHEMA " -L /xxx/xxx/xxx/xx/xxxx
 
Control File:

  USING CHARACTER SET @v_utf 

DEFINE JOB EXTRACT_FILE_LOAD

DESCRIPTION 'Export rows from a Teradata table to a file'

(

INCLUDE '/xxx/xxx/xxx/xx/xxxx/schema.schema';

DEFINE OPERATOR EXPORT_OPERATOR

TYPE EXPORT

SCHEMA @v_src_object

ATTRIBUTES

(

VARCHAR PrivateLogName = 'export_log',

VARCHAR TdpId = 'DBNAME' ,

VARCHAR UserName = 'xxxxxx' ,

VARCHAR UserPassword = 'xxxxx' ,

VARCHAR SelectStmt = @v_exportqry,

INTEGER MaxDecimalDigits = 38,

INTEGER MaxSessions = 8,

VARCHAR ReportModeOn = 'N',

VARCHAR DateForm = 'ANSIDATE'

);

DEFINE OPERATOR FILE_WRITER 

TYPE DATACONNECTOR CONSUMER 

SCHEMA @v_src_object

ATTRIBUTES

(

VARCHAR PrivateLogName='dataconnector_log',

VARCHAR DirectoryPath = @v_directorypath,

VARCHAR FileName = @v_outfile,

VARCHAR Format = 'DELIMITED',

VARCHAR OpenMode = 'Write',

VARCHAR IndicatorMode = 'N',

VARCHAR TextDelimiter = @v_delimiter_value,

VARCHAR EscapeTextDelimiter = '\',

VARCHAR DateForm = 'ANSIDATE'

);

STEP STEP_NAME

(

APPLY 

TO OPERATOR (FILE_WRITER[1])

SELECT *  

FROM OPERATOR(EXPORT_OPERATOR[1]);

);

);

You must sign in to leave a comment.