Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 21 Jul 2004 @ 17:05:31 GMT


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


Subj:   Re: MLOAD of a file with multiple record types
 
From:   zqi

i used coding below at my training and it works; should be able to resolve your issue. you don't have to seperate your data.

     .logtable lab61_log;

     .logon tdpid/username,password;

     .begin mload tables accounts, customer, trans;

     .layout lab61_layout;
      .filler tcode 1 char(1);
      .field act_nbr 2 integer;
      .field numbr * integer;
      .field str * char(25);
      .field cty * char(20);
      .field state * char(2);
      .field zip_c * integer;
      .field balf * decimal(10,2);
      .field balc * decimal(10,2);
      .field cnbr 2 integer;
      .field lnam * char(30);
      .field fnam * char(20);
      .field ssec * integer;
      .field tnbr 2 integer;
      .field tdte * date;
      .field anbr * integer;
      .field transid * char(4);
      .field tamt * decimal(10,2);

     .dml label ins_acct;
      insert into accounts values
      (:act_nbr, :numbr, :str, :cty, :state, :zip_c, :balf, :balc);

     .dml label ins_cust;
      insert into customer values
      (:cnbr, :lnam, :fnam, :ssec);

     .dml label ins_trans;
      insert into trans values
      (:tnbr, :tdte, :anbr, :transid, :tamt);

     .import infile mload_data2.txt
      layout lab61_layout
      apply ins_acct where tcode = 'A'
      apply ins_cust where tcode = 'C'
      apply ins_trans where tcode = 'T';

     .end mload;

     .logoff;


     
  <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