executing Teradata utilities on ETL server using C#.net application

Tools
Enthusiast

executing Teradata utilities on ETL server using C#.net application

hello everyone
The application i am working on has a front-end developed on .net, and i connected that to Teradata using .NET provider.

Our organization have an ETL server between TERADATA warehouse and my application server. all the teradata utilities like bteq, fastexport etc are installed on that ETL server.

So, all my BTEQ scripts, fld etc are on that server..suggest me a way to execute these commands to run scripts... like bteq xyz.out with a button click on application in C# in visual studio 2005.
i worked with putty but how to automatically login via putty is not known to me and how to pass parameter to it???

9 REPLIES
Teradata Employee

Re: executing Teradata utilities on ETL server using C#.net application

Hello,

Is it a windows based Teradata machine?

Regards,

Adeel
Enthusiast

Re: executing Teradata utilities on ETL server using C#.net application

no the teradata machine is UNIX based.
Teradata Employee

Re: executing Teradata utilities on ETL server using C#.net application

Then you might be able to use "PLink.exe". I haven't tried it myself, but you can use it as:

plink.exe -ssh -pw pass -noagent -m commands.txt user@10.0.0.2

For reference:

http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
http://fixunix.com/ssh/253629-how-pass-command-script-remote-computer-over-putty-ssh-execute.html

HTH.

Regards,

Adeel
Enthusiast

Re: executing Teradata utilities on ETL server using C#.net application

thank you very much, it is working great.... but i have few problems regarding commands.txt file:

1.when i put bteq and then .logon tdedw1/ ; in file it shows that you are successfully logged on but when i write few more command below that i.e.
BTEQ
.logon tdedw1/ ;
show table orderdetails;
it shows nothing after saying successful login.

2. when i tried to run a script saying BTEQ result.log
it gives error
C:\Documents and Settings\agandhi1\Desktop>plink.exe -ssh -noagent -m commands.t
xt user@10.xx.xxx.xxxx -pw abc
00024: Could not start program (bteq result.log): The system cannot fin
d the file specified.

FATAL ERROR: Server refused to start a shell/command

whereas with putty same command is working.

the test.btq includes:
.LOGON tdedw1/user,abc;
show table orderdetails;

thank you for your responses :-)
Teradata Employee

Re: executing Teradata utilities on ETL server using C#.net application

Well...you need to save the script and pass it to BTEQ, for that you will have to use direction operator e.g. "BTEQ < Script1.btq". Following is the sample BTEQ script:

.LOGON system1/user1,password1;
DATABASE DB1;

SELECT * FROM TABLE1;

.LOGOFF;

HTH.

Regards,

Adeel
Enthusiast

Re: executing Teradata utilities on ETL server using C#.net application

1st of all i am sorry my second point was a typing mistake it was bteq< test.btq instead of BTEQ result.log.

As u said,i put bteq result in commands.txt and executed the command:

C:\Documents and Settings\agandhi1\Desktop>plink.exe -ssh -pw password1 -noagent user1@10.xx.xx.xxx -m commands.txt

it gives error:
00050: Could not start program (BTEQ< test.btq): The system cannot find the file specified.
FATAL ERROR: Server refused to start a shell/command

i then tried:
C:\Documents and Settings\agandhi1\Desktop>plink.exe -ssh -pw Training_04 -noagent appl_student_t_04@10.xx.xx.xxx "BTEQ<test.btq"

it gives error:
00049: Could not start program (BTEQ<test.btq): The system cannot find the file specified.
FATAL ERROR: Server refused to start a shell/command

then i tried giving the full path of test.btq but it again gave error:

00055: Could not start program (D:\EDWTraining\user\BTEQ<test.btq): The filename, directory name, or volume label syntax is incorrect.

My test.btq has:
.LOGON tdedw1/user1,password1;
DATABASE abc;
select * from orderdetails;
.LOGOFF;

My commands.txt contain:
"BTEQ<test.btq" tried with quotes and also without quotes.

1 thing why it says server refused to start a shell/command?

Regards
akhshay gandhi
Teradata Employee

Re: executing Teradata utilities on ETL server using C#.net application

Try creating a shell script and running that, also check for rights/permissions and the file paths.

Regards,

Adeel
Enthusiast

Re: executing Teradata utilities on ETL server using C#.net application

thank you adeel...

yesterday i did that only.... it worked.. sorry not for updating the forum.

thank you very much for all your help..really its nice to have such helps on forum.

Sincerely
Akhshay Gandhi
Enthusiast

Re: executing Teradata utilities on ETL server using C#.net application

hi i was done with the shell script concept but the problem how to execute it from C# application.

i am using system.diagnostics.process, it executes only plink but how to pass multiple arguments is not known to me, i tried google this issue... but found nothing much, someone suggest any method i will try..

Thanking you