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:
-
Make sure the filename ends with .sql.
The query does not have to end with a semicolon.
- 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