commands of netezzasql

Upload: wahhas

Post on 07-Apr-2018

223 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/6/2019 Commands of NetezzaSQL

    1/2

    How to get help in NZSQL:

    There is help built into nzsql. When you run nzsql, you see, Welcome to nzsql, the Netezza SQL interactive

    terminal.

    Type: \h For help with SQL commands

    \? For help on internal slash commands\g or terminate with semicolon to Execute query

    \q quit

    If you type \h for help, it gives you a quick list of available commands for help:

    system(admin)=> \h

    Available help:

    ALTER AGGREGATE CREATE MATERIALIZED VIEW GENERATE STATISTICS

    ALTER CATEGORY CREATE SECURITY LEVEL GRANT

    ALTER COHORT CREATE SEQUENCE INSERT

    ALTER DATABASE CREATE SYNONYM RESET

    ALTER FUNCTION CREATE TABLE REVERTALTER GROUP CREATE TABLE AS REVOKE

    ALTER HISTORY CONFIGURATION CREATE USER ROLLBACK

    ALTER PROCEDURE CREATE VIEW SELECT

    ALTER KEYSTORE DELETE SET

    ALTER SECURITY LEVEL DROP AGGREGATE SET AUTHENTICATION

    ALTER SEQUENCE DROP CATEGORY SET CONNECTION

    ALTER SESSION DROP COHORT SET HISTORY CONFIGURATION

    ALTER SYNONYM DROP CONNECTION SET SESSION

    ALTER TABLE DROP CRYPTO KEY SET SYSTEM DEFAULT

    ALTER USER DROP DATABASE SET TRANSACTION

    ALTER VIEW DROP FUNCTION SHOW

    BEGIN DROP GROUP SHOW AGGREGATE

    CALL DROP HISTORY CONFIGURATION SHOW AUTHENTICATION

    COMMENT DROP PROCEDURE SHOW CATEGORY

    COMMIT DROP KEYSTORE SHOW COHORT

    CREATE AGGREGATE DROP SECURITY LEVEL SHOW CONNECTION

    CREATE CATEGORY DROP SEQUENCE SHOW CRYPTO KEY

    CREATE COHORT DROP SYNONYM SHOW FUNCTION

    CREATE CRYPTO KEY DROP TABLE SHOW HISTORY CONFIGURATION

    CREATE DATABASE DROP USER SHOW KEYSTORE

    CREATE EXTERNAL TABLE DROP VIEW SHOW PROCEDURE

    CREATE FUNCTION EXECUTE SHOW SECURITY LEVEL

    CREATE GROUP EXECUTE AS SHOW SYSTEM DEFAULT

    CREATE HISTORY CONFIGURATION EXECUTE PROCEDURE TRUNCATE

    CREATE PROCEDURE EXPLAIN UPDATECREATE KEYSTORE EXTRACT USER

    If you type: \? it gives you the quick reference to the "slash commands" available only in nzsql

    system(admin)=> \?

  • 8/6/2019 Commands of NetezzaSQL

    2/2

    \a toggle between unaligned and aligned mode

    \act show current active sessions

    \c[onnect] [dbname [user] [password]]

    connect to new database (currently 'system')

    \C table title

    \copy ... perform SQL COPY with data stream to the client machine\d describe table (or view, index, sequence, synonym)

    \d{t|v|i|s|e|x} list tables/views/indices/sequences/temp tables/external tables

    \d{m|y} list materialized views/synonyms

    \dS{t|v|i|s} list system tables/views/indexes/sequences

    \dM{t|v|i|s} list system management tables/views/indexes/sequences

    \dp list user permissions

    \dpu list permissions granted to a user

    \dpg list permissions granted to a group

    \dgp list grant permissions for a user

    \dgpu list grant permissions granted to a user

    \dgpg list grant permissions granted to a group

    \d{u|U} list users/User Groups

    \d{g|G|Gr} list groups/Group Users/Resource Group Users

    \da[+] [name] list aggregates, + for additional fields

    \dd [object] list comment for object

    \df[+] [name] list functions, + for additional fields

    \do list operators

    \dT list data types

    \e [file] edit the current query buffer or [file] with external editor

    \echo write text to stdout

    \f change field separator

    \g [file] send query to backend (and results in [file] or |pipe)

    \h [cmd] help on syntax of sql commands, * for all commands

    \H toggle HTML mode (currently off)

    \i read and execute queries from \l list all databases

    \o [file] send all query results to [file], or |pipe

    \p show the content of the current query buffer

    \pset set table output = {format|border|expanded|fieldsep|

    null|recordsep|tuples_only|title|tableattr|pager}

    \q quit nzsql

    \qecho write text to query output stream (see \o)

    \r reset (clear) the query buffer

    \s [file] print history or save it in [file]

    \set set internal variable

    \t show only rows (currently off)

    \time print time taken by queries

    \T HTML table tags

    \unset unset (delete) internal variable

    \w write current query buffer to a

    \x toggle expanded output (currently off)

    \! [cmd] shell escape or command