Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 29 Dec 2004 @ 23:24:17 GMT


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


Subj:   Re: Fastload from within DTS
 
From:   McCall, Glenn D

Usually, you have to "push" variables such as these from the parent script to the child process (i.e. push the user ID and password from the script that invokes the fastload process).

Your approach will only work if the fastload process is expecting to get some input from the batch process. Since fastload isn't expecting to get anything from your batch script getting the user ID and password in this fashion doesn't work. All that will happen is that the output of the batch file will be printed to the console.

Both bteq and multiload feature a "run" command. The run command takes commands from an external file and treats them as input to the bteq or multiload command. This is exactly what you need.

Unfortunately, fastload doesn't appear to support a run command so you are out of luck there.

So, one alternative is to use mload another is to use a different scripting environment.

If you are permitted to install a scripting environment with origins in Unix (eg. Bash, perl etc) you will be able to easily do what you are trying to achieve with any of the utilities. Here is an example using bash ( www.cygwin.com ). You could achieve a similar result using perl ( www.perl.org ) and a bunch of other scripting tools.

     #!/usr/bin/bash

     USR=fred    # Declare a variable containing the User ID
     PWD=pass    # and one to contain the password.
                 # both of these could be read from an external file,
                 # taken as input from the user
                 # or even passed as "command line parameters"
                 # when the script is invoked.

                 # launch fastload and take the fastload commands
                 # from this script (up to the EOI Marker).
                 # The $USR and $PWD will be substituted with the
                 # values contained in the above variables.
     fastload <


As mentioned I don't think you could do this easily in the standard windows scripting environment. This is because the windows command interpreter doesn't appear to support the <<EOI notation.

In windows, you would need to generate the fastload script into a temporary file and then pipe that temporary file into the fastload command. As in:

     set usr=fred
     set pwd=pass
     echo sessions 1,1; > c:\temp\fload.txt
     echo logon %usr%,%pwd%; >> c:\temp\fload.txt
     Etc...
     fastload < c:\temp\fload.txt

Obviously this can get messy very quickly. And, you wouldn't want to run more than one at a time unless you had some means to randomly generate file names.


I hope this helps - good luck

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