Large FastExport Pull

Database

Large FastExport Pull

I am trying to export a very large table from Teradata using the Fast Export utility. However, I keep getting a RDBMS failure, 5940: Excessively complex expression error. I have been using Fast Export for some time now and have never had an issue when selecting a small number of columns, however, I was wondering if there is some sort of size limit for tables to be exported? my end buffer is 9,195 characters for each row, so it is a very large file that should have 630 columns.

 

Is there a better way to do this? If not, should I just write a script to to break up the table horizontally and then recombine once I get all of the seperate data files? There is nothing else happening in the query besides a simple select statement from a table.

5 REPLIES
Junior Contributor

Re: Large FastExport Pull

This error is not related to the size of the table, but the size of the query. Can you share the Select?

https://www.info.teradata.com/HTMLPubs/DB_TTU_16_00/index.html#page/General_Reference/B035-1096%E2%8...

Re: Large FastExport Pull

Sure, the query is very long because as I mentioned there are 630 columns. But here it is. It is an autogenerated script based on metadata of the table. We started doing this because it is way faster than normal querying. I changed all variables to col_x in this example.

 

.LOGTABLE db.fexplog;

.LOGON ****/user, pass;

.BEGIN EXPORT;

.EXPORT OUTFILE C:/Users/path/file.txt
MODE RECORD FORMAT TEXT;

SELECT TOP 10 CAST(
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(31)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(5)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(71)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(11)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(76)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(3)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(31)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(5)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(71)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(11)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(76)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(3)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(31)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(5)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(71)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(11)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(76)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(3)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(31)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(5)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(71)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(11)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(76)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(3)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(31)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(5)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(71)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(11)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(76)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(3)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(31)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(5)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(71)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(11)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(76)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(3)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(31)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(5)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(71)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(11)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(76)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(3)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(31)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(5)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(71)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(11)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(76)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(3)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(31)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(5)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(71)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(11)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(76)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(3)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(31)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(5)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(71)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(11)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(76)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(3)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(31)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(5)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(71)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(11)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(76)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(3)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(31)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(5)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(71)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(11)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(76)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(3)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(31)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(5)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(71)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(11)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(76)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(3)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(31)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(5)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(71)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(11)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(76)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(3)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(31)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(5)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(71)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(11)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(76)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(3)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(31)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(5)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(71)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(11)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(76)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(3)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(31)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(5)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(71)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(11)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(76)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(3)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(31)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(5)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(71)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(11)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(76)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(3)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(31)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(5)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(71)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(11)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(76)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(3)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(31)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(5)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(71)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(11)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(76)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(3)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(31)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(5)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(71)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(11)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(76)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(3)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(31)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(5)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(71)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(11)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(76)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(3)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(31)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(5)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(71)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(11)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(76)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(3)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(31)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(5)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(71)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(11)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(76)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(3)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(31)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(5)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(71)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(11)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(76)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(3)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(31)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(5)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(71)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(11)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(76)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(3)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(31)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(5)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(71)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(11)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(76)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(3)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(31)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(5)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(71)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(11)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(76)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(3)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(31)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(5)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(71)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(11)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(76)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(3)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(31)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(5)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(71)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(11)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(76)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(3)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(76)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(3)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(31)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(5)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(71)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(11)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(51)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(76)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(3)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(2)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(8)),'?')||'|'||
COALESCE(CAST(col_x AS CHAR(9)),'?')||'|'||
COALESCE(CAST(CAST(col_x AS FORMAT 'Z(20)Z.ZZ') AS CHAR(15)),'?')
AS CHAR(9195))
FROM db.table
;
.END EXPORT;

.LOGOFF;

Re: Large FastExport Pull

Because we have to do similar things often, I have been developing a module to try and help this large pain point of trying to export data and get it in memory called fastteradata. The normal odbc drivers are incredibly slow, so I grab metadata, generate the fastexport / load scripts, and execute them and read the resulting files in to serialize for easier processing.

 

Just to let you know where my head is at and why I have this large of a fastexport script.

Teradata Employee

Re: Large FastExport Pull

Yes, there is a better way: switch to using TPT. The Data Connector Consumer operator can add the pipe delimiters between columns, so you won't need  a single expression with 1258 concatenation operators (not to mention CAST/COALESCE) - just select the individual column expressions to Export.

 

A bit unusual to have a file that is both fixed-width and pipe delimited.

Junior Contributor

Re: Large FastExport Pull

Of course switching from legacy FastExport to TPT will simplify a lot, including better performance due to multiple instances.

 

But if you still want to use FastExport you should consider utilizing the CSV-function. which takes care of NULLs and concatenating delimiters:

 

WITH t AS
 ( SELECT 
     --all your columns, no need for casting to string unless you need a special format
   FROM yourtable
 )
SELECT * 
FROM TABLE (Csv(NEW VARIANT_TYPE( t.col_1 t.col_2, ... ), '|', '') RETURNS (op VARCHAR(32000) CHARACTER SET Unicode)) AS t1;

As a Variant_Type is limited to 128 parameters you need to add another NEW VARIANT_TYPE for  each group of 128 columns. Overall limit is 8 Variant_Types, i.e. 8*128=1024 columns.