When you use the nzsql command in interactive mode, there are some options that you can specify. These options are called slash options because each is preceded by a backslash (\). Many slash options correspond to options available for commands entered using the command line interface.
Displays the DDL for the specified object. All the \d description options are valid only for the current database and current schema. If you have multiple schemas in a database, use the SET SCHEMA command to connect to the schema that contains the objects that you want to describe.
Lists the tables in the current database.
Lists the views in the current database.
Lists the IBM® Netezza® internal tables if you are the admin user. If you are another user, you must have the appropriate privileges. Internal tables begin with _t_.
Lists the Netezza internal views if you are the admin user. If you are another user, you must have the appropriate privileges. Internal views begin with _v_.
Displays a list of all users or a list of users and the groups in which they are members.
Displays a list of all groups or a list of all the groups and their members.
Displays a list of the groups with Guaranteed Resource Allocation (GRA) percentages.
nzsql <<eof
\echo Rowcount before the truncate
SELECT COUNT(*) FROM customer;
\echo Rowcount after the truncate
TRUNCATE TABLE customer;
SELECT COUNT(*) FROM customer;
eof
When you run this script, the system displays the messages Rowcount before (or after) the truncate count before the two select statements.
Use this option to display help for SQL syntax for a specific command. The help displays a description of the command and the command syntax. For a list of all the SQL commands and their syntax, see Netezza SQL command reference
Use this option to list all the databases and their owners.
nzsql <<eof
\! date
SELECT COUNT(*) FROM customer;
\! date
eof
Wed Jun 27 11:23:50 EDT 2014
count
-------
12399
(1 row)
Wed Jun 27 11:23:50 EDT 2014
\set my_sql 'SELECT * FROM sales_tbl WHERE amt > '
:my_sql 4000;
city | state | region | quarter | amt
------------+-------+------------+---------+------
New York | NY | Northeast | 3 | 4300
New York | NY | Northeast | 4 | 5000