Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 22 May 2008 @ 21:45:23 GMT


     
  <Prev Next>   <<First <Prev
Next>
Last>>
 


Subj:   Re: Getting column headers in Fast Export
 
From:   Michael Larkins

Hello Peter:

FastExport is really geared for unloading millions of rows into a data file. It is not really intended to create a report with headings. If you want headings and are working with a small amount of data (<500,000 rows), you should probably be using BTEQ instead. Otherwise your FastExport will need two selects, the first one to select the headings you want. I don't think you really want to do this, but I could be wrong.

     .LOGON p/p, password
     DATABASE db;
     .EXPORT FILE=load_file_R.txt
     SELECT
     cast( coalesce(month_yyyymm  , 'blank' ) AS CHAR(7)) AS month_yyyymm
     ,'|' (CHAR(1))
     ,cast( coalesce(buyer_verified   , 'blank' ) AS CHAR(15)) AS buyer_verified
     ,'|' (CHAR(1))
     ,cast( coalesce(seller_verified  , 'blank' ) AS CHAR(15)) AS seller_verified
     from db.tbl1;
     .QUIT;

This gives you a text file with the headings as the first line and one line for each row in tbl1;


Hope this helps,

Michael Larkins
Certified Teradata Master
Certified Teradata SQL Instructor



     
  <Prev Next>   <<First <Prev
Next>
Last>>
 
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023