To control how ACT handles errors when running single or multi-line SQL queries from the command line, see Using the "on-error-stop" Option in ACT.
To run a single-line SQL query from the command line:
- Type the query at the ACT prompt. The query must end with a semicolon.
- Press Enter.
For example, to list all the rows of the customer_dim table of the retail_sales database and order the results based on gender, enter this command at the ACT command-line prompt:
retail_sales=> select customer_id, gender, city_id from customer_dim order by gender; customer_id | gender | city_id ------------+--------+--------- 743 | F | 46 2711 | F | 124 744 | F | 66
You can also run commands that return information about the environment, such as:
retail_sales=> show sessionid;
which returns the session identifier for the current session.