Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Mon, 01 May 2007 @ 01:40:33 GMT


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


Subj:   Re: Using a Macro to create the mload Script
 
From:   McCall, Glenn David

  I have been told that I can use a Macro to create my Mload scripts. Does anyone know if this is possible?  


Assuming that the layout of your file is the same as the layout of the table and the data types of your file where the same as the data types of the columns in that table, then conceivably you could do this.

However, would you want to?

Imagine a macro something like this (specifically imaging the 10,000,000 queries that I have substituted with ...):

     Replace macro mload_gen (uid varchar(80), pwd varchar (32), tgt varchar(80))
     As (

     Select txt
     >From (
         Select * from (Select 1, '.logtable :tgt || '_log') as dt1 (seq,
     txt)
         Union all
         Select * from (select 2, '.logon ' || :uid || ', ' || :pwd ) as dt2
     (seq, txt)
         Union all
         ...
         Union all
         Select * from (select 99999, '.logoff') as dt99999 (seq, txt)
     ) as mload (seq, txt)
     Order by seq;

If it were me (and obviously this is just my personal opinion), I would start with a template and edit it. If you use an editor (like UltraEdit) which supports column mode editing, it should only take you a couple of minutes to create a multiload script using your template. Hint copy and paste the column names and data types from queryman using column mode in ultraedit.

I believe there are a number of multiload script generators available, but I've never used one - mostly because I use ultraedit when creating an mload or fastload script. It is also pretty good at giving me a look at the input file on those inevitable occasions (i.e. pretty much all the time) that the file layout spec and the actual file layout don't match.


Hope this helps

Glenn Mc



     
  <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