Invoke Teradata BTEQ/MLOAD scripts from unix shell script

Tools
Enthusiast

Invoke Teradata BTEQ/MLOAD scripts from unix shell script

Hi ,
I need to invoke Bteq/Mload scripts from a unix shell script to fetch data from Teradata database.Can someone help we that?

Thanks
3 REPLIES
Enthusiast

Re: Invoke Teradata BTEQ/MLOAD scripts from unix shell script

In your shell script you can use the same commends you use in windows environment:

betq < the ctl filename >> the log filename

hope this helps,
bye,
TDUser
Enthusiast

Re: Invoke Teradata BTEQ/MLOAD scripts from unix shell script

Hi TDUser,
Appreciate your help..It works..However I am facing another problem.

I am redirecting the output of btq to a log file.But the log file only captures the return code.I wish to capture the actual Teradata Failure message as well.

For e.g I get the following error "*** Failure 3706 Syntax error: expected something between the beginning of" on my screen.However the same error does not get re-directed to a log file.

Is it possible to capture the failure message in a log file?

Thanks again

Regards
Rennie
Enthusiast

Re: Invoke Teradata BTEQ/MLOAD scripts from unix shell script

Just add this BTEQ statement before the "logon":

.SET ERROROUT STDOUT