New to Teradata Utility BTEQ ( How to write a simple program in BTEQ and run a bteq script on AIX box)

Tools & Utilities

New to Teradata Utility BTEQ ( How to write a simple program in BTEQ and run a bteq script on AIX box)

Hi,

I am new to BTEQ . Can anybody tell me a very simple program to start with for eg

1. What are the syntax for BTEQ ( starting and ending)
2. a= Select max( process_id) from process_stats
a=a+1
and then pass this value 'a'as one of the Unix script varaible.
var= a
and then use $var in subsequent referencs in the script.

Would appreciate if somebody can reply.

3. How to run this Bteq from AIX box. will it be just like shell script?

1 REPLY
Enthusiast

Re: New to Teradata Utility BTEQ ( How to write a simple program in BTEQ and run a bteq script on AIX box)

BTEQ reference Manuals are available in the following link.You can refer to these manuals to learn BTEQ commands.

http://www.info.ncr.com/eTeradata-BrowseBy-Results.cfm?pl=&PID=&title=%25&release=&kword=CBTEQ&sbrn=7&nm=Teradata+Tools+and+Utilities+-+Basic+Teradata+Query+(BTEQ)

coming to your queries, BTEQ does not support the following.But you can acheive this using stored procedures in Teradata or you can export your output to a file and then use a scripting language(shell)to copy the values from the file into the environment variables to process them further.

a= Select max( process_id) from process_stats
a=a+1

or else you can write an API to connect to Teradata from your programming environment (Using ODBC,JDBC or any other driver) and redirect the query result to some scalar variables. Java,VB and perl are some of the programming environments that can be used in generating APIs to connect to teradata directly