Hi,
The BTEQ command for running a file is
.run file = blort
where blort is the name of your file.
bteq
.logon tdpid/user,password
.run file = blort1
.run file = blort2
quit;
actually if you don't like having the Password embeded in the script you could actually make a third script...
bteq
.run file = blort3
.run file = blort1
.run file = blort2
quit;
where in blort3 you put just
.logon tdpid/user,password
however I don't know the full path extended naming for blort on Windows. On UNIX I don't hvae a problem.
On WINDOWS does anyone know the full path extended naming for the blort portion of the .run file = syntax?
is it...
c:\temp\myscript.sql
or
"c:\temp\myscript.sql"
or
"c:\\temp\\myscript.sql"
or
some combination of the above?
Anyway, the easiest way to run your script is to use WINDOWS input redirection. it is identical to the Korn shell on UNIX.
bteq < inputfile > outputfile 2>&1
( the 2>&1 tell STDERR to be redirected to STDOUT which is redirected by the > to outputfile. )
now input file should contain your full logon, desired SQL, and a QUIT; to tell BTEQ you are done.
I see for your post you don't like embeding the password in the script. However even you wrote a BAT file or a PERL script to concat $1 (username) and $2 (password) into a temp file and then ran that temp file against BTEQ and then deleted, if you used AT to run the script you would have to provide all the command line arguements to the AT program and therefore anyone looking at the AT scheduler would still be able to see the username and password.
Perl program.
Now on the other hand you could write a BAT file or a PERL program to generate the bteq script into a file and then run it against BTEQ. Here is a sample perl program since it will work anywhere PERL is supported where as BAT is kind of WINDOWS centric.
perl myscript "tdpid/username,password"
here is a simple version of myscript....
$mylogon = $ARGV[0];
open OF, "> bteq.in";
print OF ".logon $mylogon\n";
print OF "sel * from dbc.dbcinfo;\n";
print OF "quit;\n";
close OF;
system ("bteq < bteq.in > bteq.out"

;
unlink "bteq.in";
Now as for scheduling it, I don't know but I thought in the Windows NT resource KIT there was an 'AT' command used for scheduling items to run at certain times.
Windows 2000 on the other hand has this built into the main product and you don't need the resource kit any more ( although the windows 2000 resource kit still contains a few net utilities ).
I heard the windows 2000 version of scheduling in far superior to the Windows NT 4.0 stuff.
Personally I have never used either so I couldn't tell you.
hope this helps.....