New to Teradata Utility BTEQ ( How to write a simple program in BTEQ and run a bteq script on AIX box)
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?
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