Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 16 Jan 2003 @ 15:36:41 GMT


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


Subj:   Re: Teradata Enquiry
 
From:   Geoffrey Rommel

  I am new to teradata database and I need to load the data from a flat file that has been downloaded from another database such as DB2 or informix. The flat file will contains data from with certain delimiters such as comma or something else.  



First of all, DB2 and Informix can export the data in fixed-length fields, so I would recommend doing that if possible. If you are loading from a mainframe EBCDIC file, the fields must be fixed-length. But if you must use delimited files, here's how.

 /* Define the input record as VARTEXT.  This works only from Unix or PC clients. */
 /* The argument after 'vartext' is the delimiter. */
set record vartext "," DISPLAY_ERRORS NOSTOP;
 /* Every field must be defined as VARCHAR. */
DEFINE
         IN_crf_mds_agg_cd         (varchar(2))
        ,IN_crf_mds_agg_ds         (varchar(50))
 FILE = /fs/fs01/data/CrfRefGC.dat;  /* your input file */

 INSERT INTO crf_dw_tbls.crfxtgc
       (
         crf_mds_agg_cd
        ,crf_mds_agg_ds
 ) VALUES (
         :IN_crf_mds_agg_cd
        ,:IN_crf_mds_agg_ds
 );


     
  <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: 27 Dec 2016