|
Archives of the TeradataForumMessage Posted: Thu, 29 Dec 2004 @ 23:24:17 GMT
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 < | ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||