All Forums Teradata Applications
11 Feb 2014
Run an teredata query on linux

Hi ,

I am in badly need of some direction here :) there is an batch file(.bat) which runs an teredata query on windows, but for some reasons i will have to use Linux server from now on

current set up 



echo off

bteq < D:\commands.txt > D:\output.txt 2>&1

@echo off goto end

:end @echo exit 



.LOGON ------

select (date);


works fine on windows


how can i do this on red hat - linux? and is it necessary to have bteq utilities or any other Teredata utilities , i have got teredata ODBC drivers on linux though. it would be great if any one could give an insight onto this ?


Thank you

Raja_KT 1246 posts Joined 07/09
11 Feb 2014

You need a client. Do you have knowledge on linux or unix scripting?
(In linux or unix , more programming flexibilities and fun :) )
from any directory , you can run this  and see if bteq say is available or not:
find / -name "bteq*" -type f -print 2>/dev/null
or you can just see if some td elements are there or not : 
which bin
try with this ksh script.

export DB_NAME=dd01




export LOG_FILENAME=$HOME/raja.log

bteq<<! >>${LOG_FILENAME} 2>&1



.run file $HOME/abc.sql



Raja K Thaw
My wiki:
Street Children suffer not by their fault. We can help them if we want.

12 Feb 2014

Thank you Raja,that helped a lot 

You must sign in to leave a comment.