bat file that captures status of a bteq

Database
Enthusiast

bat file that captures status of a bteq

all,
can some one provide a small example of how to capture the status of a bteq in a windows batch file.

***batchfile****
@echo on
echo started batch file
status ( bteq < samplebteq.txt) // i am calling the bteq which resides in a file
echo status

I could do this in UNIX but could not do this in windows batch.

i appreciate your help
Thanks

2 REPLIES
Enthusiast

Re: bat file that captures status of a bteq

Try the %ERRORLEVEL% variable as shown below.

***batchfile****
@echo on
echo started batch file
bteq < samplebteq.txt
echo %ERRORLEVEL%

And here's a URL that you might find useful for DOS batch commands.

http://labmice.techtarget.com/articles/batchcmds.htm#variable

regards,
Marcus Joseph
Enthusiast

Re: bat file that captures status of a bteq

Thanks Marcus
i will try it!