All Forums Connectivity
24 Jun 2014
Executing Teradata sql script in Shell file

I am new to Teradata.
Please help me to know how to execute the simple Teradata script from LINUX shell script.
I created  a shell file and the code inside the shell file is below:
#! /bin/bash
select * from employee where emp_id = $1;
 I execute the script ./ 20 > output.txt ( I am passing the value 20 as emp_id )
By executing the above command, I would like to print the output of the sql query in the file 'output.txt'.
But it is not working.
I am getting the below error:
".logon command not found
.logoff command not found"
Please someone help me on this.

Raja_KT 1246 posts Joined 07/09
24 Jun 2014

You do not invoke  bteq..... something like this:
bteq <<EOF >> $HOME/abc.dat 2>/&1
your logon 
your report file .....something like : .export report file= $PWD/def.dat
.export reset
Try and let me know.

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

You must sign in to leave a comment.