TPT Export-Template is a file producer which works similar to Fastexport utility. Advantage of Export-Template is that it eliminates the need to define separate TPT script for each of the table.
There are five data formats in which data can be exported using TPT. Please visit TPT-Export page for detail of each format type.#tpt_export_template.tpt USING CHARACTER SET @var_utf DEFINE JOB tpt_export_template ( APPLY TO OPERATOR ($FILE_WRITER() ATTR (FileName=@var_outfile, Format=@var_format, TextDelimiter=@var_delimiter_value, DirectoryPath=@var_directorypath)) SELECT * FROM OPERATOR($EXPORT() ATTR (TdpId=@var_tdpid, UserName=@var_userid, UserPassword=@var_password, SelectStmt=@var_exportquery, MaxSessions=@var_maxsessions, DateForm = @var_dateform, MaxDecimalDigits = 38)); );Click here to download the above Export-Template script.
tbuild -f /path_to_file/tpt_export_template.tpt \ -u " var_tdpid='TDSERVER', \ var_userid='tutorial_user', \ var_password='tutorial_user', \ var_exportquery='LOCK ROW FOR ACCESS SELECT * FROM tutorial_db.employee;' , \ var_directorypath='/path_to_output_file', \ var_outfile='export_template_outfile.txt', \ var_delimiter_value='|*|', \ var_utf='UTF8', \ var_maxsessions=4, \ var_dateform='ANSIDATE' \ var_format='DELIMITED'"
tbuild -f /path_to_file/tpt_export_template.tpt \ -u " var_tdpid='TDSERVER', \ var_userid='tutorial_user', \ var_password='tutorial_user', \ var_exportquery='LOCK ROW FOR ACCESS SELECT * FROM tutorial_db.employee;' , \ var_directorypath='/path_to_output_file', \ var_outfile='export_template_outfile_unformatted.txt', \ var_delimiter_value='none', \ var_utf='UTF8', \ var_maxsessions=4, \ var_dateform='ANSIDATE' \ var_format='UNFORMATTED'"
tbuild -f /path_to_file/tpt_export_template.tpt \ -u " var_tdpid='TDSERVER', \ var_userid='tutorial_user', \ var_password='tutorial_user', \ var_exportquery='LOCK ROW FOR ACCESS SELECT * FROM tutorial_db.employee;' , \ var_directorypath='/path_to_output_file', \ var_outfile='export_template_outfile_formatted.txt', \ var_delimiter_value='none', \ var_utf='UTF8', \ var_maxsessions=4, \ var_dateform='ANSIDATE' \ var_format='FORMATTED'"
tbuild -f /path_to_file/tpt_export_template.tpt \ -u " var_tdpid='TDSERVER', \ var_userid='tutorial_user', \ var_password='tutorial_user', \ var_exportquery='LOCK ROW FOR ACCESS SELECT * FROM tutorial_db.employee;' , \ var_directorypath='/path_to_output_file', \ var_outfile='export_template_outfile_binary.txt', \ var_delimiter_value='none', \ var_utf='UTF8', \ var_maxsessions=4, \ var_dateform='ANSIDATE' \ var_format='BINARY'"