Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.


Get your key and initialization vector (IV) value as described in Field-Level Encryption. A summary of those steps are:

  1. Open Key Management for your account.
  2. To create a symmetric key, provide the required information.
  3. Generate the key value for the pre-shared key field using a cryptographically secure random number generator.
  4. Your internal team can provide information for obtaining the key.
  5. Save your key and return to the Key Management page.
  6. To create an initialization vector (IV), provide the required information. Use a 32-character hexadecimal string for the IV value.
  7. Save your IV.

Use the TD Console to Create your Connection

Create a New Connection

In Treasure Data, you must create and configure the data connection before running your query. As part of the data connection, you provide authentication to access the integration.


Excerpt Include
PD:Exporting Your Query Data to Your Destination
PD:Exporting Your Query Data to Your Destination

In TD Console, navigate to Queries and select New Query to access the query editor. You can pick the query language and write your query. Select Output Results.

Image Removed


Complete the Configuration Fields

From here, enter your target columns to be encrypted. Key and IV are required to encrypt the columns before sending to SMC SFTP server

Image Removed

 After After you complete the configuration dialog, if you want to edit and update any fields in the configuration dialog, you must re-enter your key and IV to send encrypted data to SFMC.  

If you don't want to encrypt data sending to SMC SFTP, leave encryption columns, key, IV, blank.

Integration Parameters for SFTP Server Export Integration

Some MA tools will try to import data when a file with a specific name exists on the SFTP server. The temp name option is useful for such cases.

Image Added

Is user directory root?

Treat the user directory as the root directory (ex. '/home/treasure-data/' as '/')

Path prefix

Files will be stored at this path

Rename file after upload finish

Upload with ".tmp" suffix first, then rename to the expected filename

SFTP result output renames the file on the remote SFTP server from “.xxx.tmp” to “.xxx” after all the data is transferred

FormatCSV or TSV
CompressionNone, GZ, or bzip2
Header line?

Write the header line with column name as the first line


Delimiter character such as, for CSV, "\t" for TSV, "|" or any single-byte character

Quote PolicyALL, Minimal, None
Null string

Defaults to empty string for CSV, '\N' for TSV

End-of-line characterCRLF, LF, CR
Temp filesize thresholdMaximum file size (in bytes) of local temp file, that temp file will be flushed to remote file when it reaches the threshold

Example Queries

Retrieve Selected Columns from the Values Table 

Code Block
SELECT id, name, email FROM (\
VALUES (1,'a','’),\
) tbl (id, name, email)

Retrieve Everything from the Web Access Table

Code Block
select * from www_access

Verifying Results

After successful completion of the query, the query result is automatically imported to the specified Container destination.

After the job finishes, you can check the output file on SMC the Salesforce Marketing Cloud SFTP server by using the general SFTP command, for example: