Running Queries from a File - Aster Client

Teradata Aster® Client Guide

Product
Aster Client
Release Number
7.00
Published
May 2017
Language
English (United States)
Last Update
2018-04-13
dita:mapPath
hki1475000360386.ditamap
dita:ditavalPath
Generic_no_ie_no_tempfilter.ditaval
dita:id
B700-2005
lifecycle
previous
Product Category
Software
To control how ACT handles errors when running SQL queries from a file, see Using a Configuration File to Pass ACT Startup Parameters.

To run a query stored in a file:

  1. Make sure the filename ends with .sql.

    The query does not have to end with a semicolon.

  2. At the prompt, enter this command:
\i <filename>

For example, consider this query stored in the file myQuery.sql:

SELECT *
FROM customer_dim
ORDER BY gender

To run this query, enter this command at the ACT command prompt:

retail_sales=> \i myQuery.sql

You can also run this query using the –f flag of the ACT command. For example:

[root@localhost ~]# act -d retail_sales -w beehive -f myQuery.sql