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 

**test.bat***

 

echo off

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

@echo off goto end

:end @echo exit 

commands.txt

 

.LOGON ------

select (date);

.LOGOFF

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

Tags:
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 DB_USER_NAME=BATCH_1

 

DB_PASSWORD=xyz

export LOG_FILENAME=$HOME/raja.log

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

 

.logon ${DB_NAME}/${DB_USER_NAME},${DB_PASSWORD}

.run file $HOME/abc.sql

.quit

!
Cheers,

Raja K Thaw
My wiki: http://en.wikipedia.org/wiki/User:Kt_raj1
Street Children suffer not by their fault. We can help them if we want.

12 Feb 2014

Thank you Raja,that helped a lot 
 
cheers!!

You must sign in to leave a comment.