SQL assistant vs BTEQ

Tools & Utilities
Enthusiast

SQL assistant vs BTEQ

Can anyone tell me the difference btw running a query or set of query in sql assistant and BTEQ?

24 REPLIES
Enthusiast

Re: SQL assistant vs BTEQ

BTEQ uses CLIv2 while SQL Assistant uses ODBC driver to connect to Teradata Server.The basic difference between the two is that BTEQ is a command driven utility while SQL Assistant is a GUI.Both used to submit queries to Teradat.

BTEQ has its own command using which you can create and run scripts to run queries in a batch.BTEQ supports conditional logic (IF..THEN construct).

Enthusiast

Re: SQL assistant vs BTEQ

Besides Very useful information provided by Jim..
BTEQ can be run in a batch mode for exportin,importing (small volumes of data).
I can also be used to run useful reports. It can be installed both on Unix and Windows machine.

While SQL assistant does allow import/exports but I find BTEQ to be more useful.

Thanks,
Vinay Bagare
Enthusiast

Re: SQL assistant vs BTEQ

Like to add that
BTEQ supports Teradata Specific SQL such as OLAP Function( With by , With, RANK etc), which are not supported by any client utility connected using ODBC.
Although there are other equivalent functions available for ODBC, but using ODBC always produces a relational output.

Thanks
Enthusiast

Re: SQL assistant vs BTEQ

I found the replies very useful.

Next my doubt is do we have to instal any utility (BTEQ) to run the bteq queries or what is the means to run bteq scripts?
Enthusiast

Re: SQL assistant vs BTEQ

"Bteq" script is nothing but a bunch of SQLs and any other Bteq commands (like logon, transaction mode, width etc etc .... ) wrapped in a file. (most of us save it with an extension of .bteq but it doesn't matter).

This is mostly useful for batch processing when you can put in all the SQLs and bteq command in a file and use bteq to run it from a scheduler ...

bteq < processdata.bteq

Enthusiast

Re: SQL assistant vs BTEQ

so does bteq have a scheduler in it?
can we schedule the bteq scripts to our requirements using the bteq tool itself or get it done through the script in bteq?
Enthusiast

Re: SQL assistant vs BTEQ

Bteq has no scheduler, it's just a utility to execute SQLS, do a little bit of formating, export/import small scale data and capable of doing teeny-weeny if else conditions. ... nothing more (that I could remember :o) ...

you will have to use a scheduler to run bteq scripts at a certain time ... like cron/at in unix, windows scheduler etc ... (and tones of other third party schedulers available out there)
Enthusiast

Re: SQL assistant vs BTEQ

Hi,
After all the things said in the past replies, I noticed one major point missing in the replies which is a major difference between the 2 tools mentioned:

1. Conditional logic can be applied in BTEQ whereas SQL Assitant can use only single statements with no conditional logic (.if statements).
2. The output of BTEQ reult sets are more proper to formatting statements. Any formatting applied to BTEQ outputs are exactly as specified. Whereas SQL Assitant applies its own formatting to the result set. Hence you cannot assure that the format of the string from SQL Assitant is the right one as specified in the outputting call string.
3. The import or export facility is very bare minimal in SQL Assitant whereas BTEQ's import export functionality is much more versatile and flexible and programmable.

A BTEQ script is nothing but a simple file in UNIX or Windows environment which can be run using the following command:
bteq < infle > outfile where infile is the BTEQ script and outfile is the output or log file.
Now how you call the BTEQ command above is your option whether you use a cron or scheduler or do a one time prompt call etc.

Hope that helps.
Enthusiast

Re: SQL assistant vs BTEQ

that was much clear explanation