Auto Save Query Results

Teradata Studio
Enthusiast

Auto Save Query Results

Is there any syntax that will allow you to automatically save the results of a query to a .txt file?

 

Thanks


Accepted Solutions
Teradata Employee

Re: Auto Save Query Results

Pressing the rightmost button in the SQL Editor's toolbar (the wrench) brings up the SQL Handling preference page. The Results Handler part of the page lets you choose whether the results of queries are written to a file (Teradata Export Wizard (File Export)) or displayed in the Terdata Result Set Viewer. When you select Teradata Export Wizard (File Export), you will be presented with a dialog having you specify the name, location and file type of where the results are to be stored.

 

If you select Delimited Text as the file type, you can specify the column delimiter, character string delimiter and file encoding. You can also choose to save the results in an Excel spreadsheet.

1 ACCEPTED SOLUTION
2 REPLIES
Teradata Employee

Re: Auto Save Query Results

Pressing the rightmost button in the SQL Editor's toolbar (the wrench) brings up the SQL Handling preference page. The Results Handler part of the page lets you choose whether the results of queries are written to a file (Teradata Export Wizard (File Export)) or displayed in the Terdata Result Set Viewer. When you select Teradata Export Wizard (File Export), you will be presented with a dialog having you specify the name, location and file type of where the results are to be stored.

 

If you select Delimited Text as the file type, you can specify the column delimiter, character string delimiter and file encoding. You can also choose to save the results in an Excel spreadsheet.

Enthusiast

Re: Auto Save Query Results

Thank you for the response.  I actually tried that, but there is a limitation as to the filename with what I was attempting.  I had about 2000 different consecutive SHOW VIEW scripts that I wanted to store each .txt as the database.view name.  I ended up creating a BTEQ script to create the individual files for me.

 

I wish TD would allow the use of the ECHO command as Oracle does in queries.

 

Regards