Run an teredata query on linux

Teradata Applications
Enthusiast

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 (2)
2 REPLIES
Enthusiast

Re: Run an teredata query on linux

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,

Enthusiast

Re: Run an teredata query on linux

Thank you Raja,that helped a lot 

cheers!!