Archives of the TeradataForum
Message Posted: Thu, 06 Nov 2008 @ 20:33:27 GMT
Subj: | | Re: Fastexport HEX chars at the beginning of each record |
|
From: | | Bob Hahn |
As others have said, with FastExport you must concatenate a cast of each field to char or varchar plus literal field delimiters. If the 2 byte
length is a problem cast the entire string to fixed character. To get a row delimiter specify 'format text' on the .export statement (or
concatenate it).
With the TPT Export Operator, the Data Connector can add the field and record delimiters but you are still required to cast every field to
character or varchar in the sql statement in the export operator.
There's another trick, with BTEQ use 'set separator' and export in report mode. It is single session, and uses field mode (so Teradata does
the convert to character), and uses a lot more client cpu and is slower than FastExport or TPT Export. But you don't have to cast every field and
concatenate literal delimiters--you can even use 'select *'. For smaller exports it is fine.
Similarly, with the TPT SQL Selector Operator you don't have to cast every field to character because it also uses field mode so Teradata
converts to character and the DC can add the field/record delimiters. Again, it is single session and a lot slower than FastExport or the TPT
Export Operator and uses significantly more client cpu.
Here's a simple BTEQ example.
.set titledashes off;
.set separator ',';
.set session respbuflen max1mb; /* these next 2 .sets maximize return
throughput */
.set session tworespbufs on; /* default */
.os rm outfile; /* otherwise it appends to existing file */
.export report file=outfile;
select * from t1;
.export reset;
.logoff;
.quit;
|