Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 03 Dec 2003 @ 10:41:30 GMT


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


Subj:   Re: MLOAD - Multiple record types
 
From:   tristan.bayliff

Hi Jim,

an example taken from something I've used before is below. It's to different tables but I don't see why it shouldn't be possible to write to the same table.


Cheers,

Tris Bayliff.


-----------------------------------------
.begin import mload
       tables       table, table_hdr, table_trl
       worktables   table_wt, table_hdr_wt, table_trl_wt
       errortables  table_et
                    table_uv
                   ,table_hdr_et
                    table_hdr_uv
                   ,table_trl_et
                    table_trl_uv
 ;

.layout file_layout                        ;
.field  record_type        *    char(1)    ;
/* data record */
.field  data               *    .....      ;
/* header record */
.field  hdr_data           2    .....      ;
/* trailer record */
.field  trl_data           2    .....      ;

.dml label data_ins ;
 insert into table (data) values (:data) ;

.dml label hdr_ins ;
 insert into table_hdr (hdr_data) values (:hdr_data) ;

.dml label trl_ins ;
 insert into table_trl (trl_data) values (:trl_data) ;

.import infile filein
        layout file_layout
        apply  data_ins where record_type = 'D'
        apply  hdr_ins  where record_type = 'H'
        apply  trl_ins  where record_type = 'T'
 ;


     
  <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: 23 Jun 2019