Exporting to flatfile

Tools

Exporting to flatfile

Is there a way to export to a delimited flatfile using quoted text and escaping delimiters?  So far, I'm doing the following, and it doesn't work.

 

My vars file is:

 

  SourceTdpId           = 'tdprod.bigdata.expecn.com'
, SourceUserName        = 'username'
, SourceUserPassword    = '$tdwallet(token)'
, SourceLogonMech       = 'LDAP'
, SourceMaxSessions     = 10
, SourceSpoolMode       = 'NoSpool'
, ExportPrivateLogName  = 'exportprivate.log'
, TargetDirectoryPath   = 'data'
, TargetFormat          = 'delimited'
, TargetOpenMode        = 'write'
, TargetTextDelimiter   = ','
, TargetQuotedData      = 'Yes'
, MaxDecimalDigits      = 38
, DateForm              = 'ANSIDATE'

/********************************************************/
/* APPLY STATEMENT parameters                           */
/********************************************************/
, ExportInstances       = 1
, WriterInstances       = 1

My query file is:

 

 

USING CHARACTER SET @v_utf
DEFINE JOB exporttofile
(
  APPLY TO OPERATOR ($FILE_WRITER[@WriterInstances]
            ATTR (FileName = @v_filename
                            ))
  SELECT * FROM OPERATOR($EXPORT[@ExportInstances]  ATTR (
    DateForm       = 'ANSIDATE',
    SelectStmt     = 'SELECT * from ' || @v_dbtbl || @v_where || ';'
                     ));
);

You can see that I've added a variable called "TargetQuotedData" to the variable file, but it doesn't seem to help.

 

Tags (2)
4 REPLIES
Enthusiast

Re: Exporting to flatfile

Re: Exporting to flatfile

Unfortunatly not.  I'm looking for something I can productionalize.  Additionally, SQL Assistant doesn't work on my mac.  I'm specifically asking how this is done in TPT.

Teradata Employee

Re: Exporting to flatfile

The Data Connector operator can handle a variety of "quoted data" styles on input, but I don't believe it supports adding quotes on output.

Teradata Employee

Re: Exporting to flatfile

TPT will add quotes to the output file if you set QuotedData to "yes".

 

-- SteveF