Archives of the TeradataForum
Message Posted: Tue, 22 May 2012 @ 15:33:39 GMT
I am looking for pointers on TPT Exporter operator usage
Requirement : Export the data from a table to flat file with pipe delimiter
Error faced :
Assume that I need to export the below two columns then my typical syntax is below SELECT TRIM(ACCOUNTNAME)
DEFINE OPERATOR data_reader() DESCRIPTION ' TPT Export Operator usuage' TYPE EXPORT SCHEMA source_table ATTRIBUTES ( VARCHAR PrivateLogName = 'c:\tpt\tpt_fastexport_log', INTEGER MaxSessions = 5, INTEGER MinSessions = 1, VARCHAR TdpId = 'XXXXXXX', VARCHAR UserName = 'xxx', VARCHAR UserPassword = 'xxxx', VARCHAR EscapeTextDelimiter ='#', VARCHAR EscapequoteDelimiter ='\', VARCHAR SelectStmt = 'SELECT TRIM(ACCOUNTNAME) ||'|'|| TRIM(CPU) FROM DWH_DBA.ACCTG; ' );
When I run the script , I see a error " single pipe character " |" encountered where double is expected", which means the first chunk
'SELECT TRIM(ACCOUNTNAME) ||'
is considered and second
| ' |'|| TRIM(CPU) FROM DWH_DBA.ACCTG; '
as second part, so I need to escape the character 'ingle quotes' to achieve this, but I tried with different options and it didn't work out. Any pointers to problem would be of great help.
'SELECT TRIM(ACCOUNTNAME) ||#'|#'|| TRIM(CPU) FROM DWH_DBA.ACCTG; ' (Same error)
|Copyright 2016 - All Rights Reserved|
|Last Modified: 23 Jun 2019|