Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 26 Feb 2010 @ 14:03:39 GMT


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


Subj:   Re: How to pass database name as parameter
 
From:   Mohommod.Khan

Anomy

One way you can do this is dynamically create the top part of the script. If you can take the few parameters and combine with your mload script and then run it, I think that will do the work.

On top of the script, you may do some thing like this:

     -------------------------------------------------------------------
     .SET DATABASENAME TO   'my DB';
     .SET TARGETTABLE  TO   'my Table ';
     .SET IMPORTTABLE  TO   '&DATABASENAME..&TARGETTABLE';
     .SET WORKTABLE    TO   '&DATABASENAME..WT_&TARGETTABLE';
     .SET ERRORTABLE   TO   '&DATABASENAME..ET_&TARGETTABLE';
     .SET UVTABLE      TO   '&DATABASENAME..UV_&TARGETTABLE';
     -------------------------------------------------------------------
     /*** on your Mload script you can now accept the above variables: *******/

     DROP TABLE &ERRORTABLE;
     DROP TABLE &UVTABLE;
     DROP TABLE &WORKTABLE;

     .BEGIN IMPORT MLOAD
         TABLES
            &IMPORTTABLE
         WORKTABLES
            &WORKTABLE
         ERRORTABLES
            &ERRORTABLE
            &UVTABLE
     -------------------------------------------------------------------

In UNIX/DOS you can just 'cat'/'echo' the two and create your script. Hope this helps.


Thanks



     
  <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