TPT export description column with carriage return and line feed WITH oTranslate

Tools & Utilities
Enthusiast

TPT export description column with carriage return and line feed WITH oTranslate

Hello,

       I am trying to export a table which has a product-description column which contains "carriage return and line feed".

I receive the following error while doing the export:

-----------------------------------------------------------------------------------------------------------------------------------------------------------------

TPT_INFRA: TPT03589: in SELECT part. Check with the syntax below.

  APPLY {dml-list} TO OPERATOR
        (operator-name {[n]} {ATTR (attribute-list)})
  SELECT {(column-list) | *} FROM OPERATOR
        (operator-name {[m]} {ATTR (attribute-list)});

  Comma separated multiple APPLY statements can be specified.
  UNION ALL separated multiple SELECT statements can be specified.

Compilation failed due to errors. Execution Plan was not generated.
Job script compilation failed.

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------

-------------------------------------JOBVAR_PRODUCT------------------------------------------

SourceTdpId                    = 'xx.xx.xx.xx',
SourceUserName            = 'userid',
SourceUserPassword     = 'password',
ExportPrivateLogName   = 'exp_privlog_PRODUCT',
ExportTraceLevel       = 'none',
ExportTenacityHours    = 1,
ExportTenacitySleep    = 1,
ExportMaxSessions      = 4,
ExportMinSessions      = 4,
ExportDateForm         = 'ANSIDATE',
ExportSelectStmt       = 'SELECT * FROM TEST.PRODUCT;',
ExportWorkingDatabase  = 'TEST_XX',
ExportSpoolMode        = 'noSpool',

FileWriterFormat           = 'Delimited',
FileWriterTraceLevel       = 'none',
FileWriterFileName         = 'PRODUCT.txt.gz',
FileWriterDirectoryPath    = '/export/data',
FileWriterOpenMode         = 'Write',
FileWriterIndicatorMode    = 'N',
FileWriterTextDelimiter    = '|',
FileWriterPrivateLogName   = 'file_privlog_PRODUCT'

-----------------------------------------------------------------------------------------------------------------------------------

----------------------------------export_PRODUCT------------------------------------------------------------------------

USING CHAR SET UTF8
DEFINE JOB TABLE_DATA_EXPORT_PRODUCT
DESCRIPTION 'EXPORT TABLE'
(

       APPLY TO OPERATOR ($FILE_WRITER[4])
       SELECT PRODUCT_KEY, PRODUCT_NUMBER, (oTranslate(PRODUCT_DESC, '0A0D'xc,'')) as PRODUCT_DESC, PRODUCT_SUBCATEGORY_KEY FROM OPERATOR ($EXPORT[4]);
);

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

tbuild -f export_PRODUCT -j 27291_PRODUCT_RunUnload -v jobvar_PRODUCT -e UTF8 -z 60 -C  2>&1

 

Thanks.


Accepted Solutions
Teradata Employee

Re: TPT export description column with carriage return and line feed WITH oTranslate

The function call has to be coded in the ExportSelectStmt attribute string, since that is processed on the database side; the SELECT in the APPLY clause is processed on the TPT client. Note that the quotes will need to be "escaped" (doubled) within the string.

 

Also, you generally do not want to use more than one instance of EXPORT. It's fine to have multiple writer instances if you want the output split (-C); the number of consumer instances need not match the number of producer instances.

 

1 ACCEPTED SOLUTION
2 REPLIES
Teradata Employee

Re: TPT export description column with carriage return and line feed WITH oTranslate

The function call has to be coded in the ExportSelectStmt attribute string, since that is processed on the database side; the SELECT in the APPLY clause is processed on the TPT client. Note that the quotes will need to be "escaped" (doubled) within the string.

 

Also, you generally do not want to use more than one instance of EXPORT. It's fine to have multiple writer instances if you want the output split (-C); the number of consumer instances need not match the number of producer instances.

 

Enthusiast

Re: TPT export description column with carriage return and line feed WITH oTranslate

It is working Now. Thanks For Your Help !!!