NZSQL Commands
NZSQL Commands
Command: BEGIN
Description: Begins a transaction in chained mode
Syntax:
BEGIN [ WORK | TRANSACTION ]
Command: CALL
Description: Invoke a procedure
Syntax:
CALL procedure_name(arguments)
Calls the procedure
arguments are a list of constant/literal arguments to the procedure.
The arguments may themselves be results of functions, so long as the procedur
es
only take constant/literal arguments as well.
Is equivalent to EXECUTE procedure_name(args) or SELECT procedure_name(args)
Command: COMMENT
Description: Add comment to an object
Syntax:
COMMENT ON
[
[ DATABASE | SEQUENCE | SYNONYM | TABLE | VIEW | FUNCTION | AGGREGATE | PROCED
URE | LIBRARY ]
object_name |
COLUMN table_name.column_name|
] IS 'text'
For FUNCTION, PROCEDURE and AGGREGATE, object_name will be of the form name(ar
gs).
Command: COMMIT
Description: Commits the current transaction
Syntax:
COMMIT [ WORK | TRANSACTION ]
Command: CREATE AGGREGATE
Description: Create or replace a User Defined Aggregate
Syntax:
CREATE [ OR REPLACE ] AGGREGATE aggregate_name(argument_types)
RETURNS return_type
STATE (state_types)
LANGUAGE CPP
PARAMETER STYLE NPSGENERIC
[ MAXIMUM MEMORY [ '0' | '100' | '1k' | '10k' | '100k' | '1m' | '10m' ] ]
[ LOGMASK mask ]
[ NO DEPENDENCIES | DEPENDENCIES deplibs ]
[ TYPE ANY | ANALYTIC | GROUPED]
EXTERNAL CLASS NAME 'class_name'
EXTERNAL HOST OBJECT 'host_object_filename'
EXTERNAL SPU OBJECT 'SPU_object_filename'
Create (or replace) a user defined aggregate
argument_types is a list of fully specified arguments and types.
All NPS types are supported.
Strings must have either a size or ANY for generic.
NUMERICS must have either precision and scale, or ANY for generic.
return_type is one fully specified argument and type.
Follows same rules as argument_types, except does not support ANY.
state_types is a list of fully specified arguments and types.
Follows same rules as argument_types, except does not support ANY.
MAXIUM MEMORY specifes expected maximum memory used.
mask specifies the log mask. Can be one or a comma separated list of:
{ DEBUG, TRACE, NONE }
deplibs specifies the library dependencies . Can be one or a comma separated
list of library names
NO DEPENDENCIES specifies that there are no dependencies for the aggregate,
which is the default
if DEPENDENCIES deplibs is omitted.
class_name specifies the name of the C++ class that implements the aggregate
.
host_object_filename specifies the pathname of the host's compiled object
file.
SPU_object_filename specifies the pathname of the SPU's
compiled object file.
Type specifies the context in which the UDA can be called. ANALYTIC means
only for window aggregates, GROUPED means from grouped or grand aggregates
and ANY means both contexts.
Note: The system permits and maintains PRIMARY KEY, DEFAULT, FOREIGN KEY,
UNIQUE, and REFERENCES. The NPS does not support constraint checks
and referential integrity. It is up to the user to ensure constraint
checks and referential integrity.
Create a new keystore. The only keystore type for this version is LOCAL; a
keystore maintained on the NPS. The password is a password for the keystore
which is used for encryption of the key data in the store.
NOTE: The system permits and maintains UNIQUE, PRIMARY KEY, DEFAULT, and REFERE
NCES.
The NPS does not support constraint checks and referential integrity. It
is up
to the user to ensure constraint checks and referential integrity.
Command: DELETE
Description: Removes rows from a table
Syntax:
DELETE FROM table [ WHERE condition ]
Command: DROP AGGREGATE
Description: Drop a User Defined Aggregate
Syntax:
DROP AGGREGATE aggregate_name(argument_types)
Drops the aggregate
argument_types is a list of fully specified arguments and types.
All NPS types are supported.
Strings must have either a size or ANY for generic.
NUMERICS must have either precision and scale, or ANY for generic.
Command: EXECUTE AS
Description: Change the user identity under which the session is currently opera
ting.
Syntax:
EXECUTE AS user_name(arguments)
Changes the current user of the session to the specified user name.
user_name is the name of a
user on the NPS. You must have EXECUTE AS permission on that user in order
to perform the EXECUTE AS statement.
Command: REVOKE
Description: Revokes access privilege from a user, a group or all users.
Syntax:
REVOKE [ GRANT OPTION FOR ] object_privilege [, ...]
ON object [, ...]
FROM { PUBLIC | GROUP groupname | username }
REVOKE [ GRANT OPTION FOR ] admin_privilege [, ...]
FROM { PUBLIC | GROUP groupname | username }
object_privilege
ALL, ABORT, ALTER, DELETE, DROP, EXECUTE, EXECUTE AS,
GENSTATS, INSERT, LABEL ACCESS, LABEL RESTRICT, LABEL EXPAND,
LIST, SELECT, TRUNCATE, UPDATE
admin_privilege
ALL ADMIN, BACKUP, [ CREATE ] DATABASE, [ CREATE ] GROUP,
[ CREATE ] INDEX, [ CREATE ] SEQUENCE, [ CREATE ] SYNONYM,
[ CREATE ] TABLE, [ CREATE ] EXTERNAL TABLE, [ CREATE ] TEMP TABLE,
[ CREATE ] FUNCTION, [ CREATE ] AGGREGATE, [ CREATE ] USER,
[ CREATE ] VIEW, [ CREATE ] MATERIALIZED VIEW, [CREATE] PROCEDURE,
[ CREATE ] LIBRARY, [ MANAGE ] HARDWARE, [ MANAGE ] SYSTEM, [ MANAGE ] SECUR
ITY, RECLAIM, RESTORE
Command: ROLLBACK
Description: Aborts the current transaction
Syntax:
ROLLBACK [ WORK | TRANSACTION ]
Command: SELECT
Description: Retrieve rows from a table or view.
Syntax:
SELECT [ ALL | DISTINCT ]
* | column [ AS output_name ]| expression [ AS output_name ] [, ...]
[ FROM from_item [, ...] ]
[ WHERE condition ]
[ GROUP BY expression [, ...] ]
[ HAVING condition [, ...] ]
[ { UNION | INTERSECT | EXCEPT | MINUS [ ALL | DISTINCT ] } select ]
[ ORDER BY expression [ ASC | DESC | USING operator ] [, ...] ]
[ LIMIT { count | ALL } ]
where from_item can be:
table_name
[ [ AS ] alias [ ( column_alias_list ) ] ]
|
( select )
[ AS ] alias [ ( column_alias_list ) ]
|
from_item [ NATURAL ] join_type from_item
[ ON join_condition | USING ( join_column_list ) ]
Command: SET
Description: Set run-time parameters
Syntax:
SET variable { TO | = } { value | 'value' | DEFAULT }
SET TIME ZONE { 'timezone' | LOCAL | DEFAULT }
Command: SET AUTHENTICATION
Description: Sets the system authentication method settings
Syntax:
SET AUTHENTICATION { LOCAL | LDAP ldap_settings }
ldap_settings ::= BASE base_string
SERVER server
[ VERSION version_number ]
[ BINDDN bind_string ]
[ BINDPW bind_password ]
[ PORT port ]
[ SCOPE { SUB | ONE | BASE } ]
[ SSL { ON | OFF } ]
[ ATTRNAME attrname_string ]
[ NAMECASE { LOWERCASE | UPPERCASE } ]
Command: SET CONNECTION
Description: Sets the system connection settings
Syntax:
SET CONNECTION { LOCAL | HOST | HOSTSSL | HOSTNOSSL }
DATABASE { db_string | ALL }
[ IPADDR ip addr ]
[ IPMASK ip addr mask ]
Command: SET HISTORY CONFIGURATION
Description: Sets a history configuration.
Syntax:
SET HISTORY CONFIGURATION name
Set the history configuration named name to be the active history
configuration. The new setting will take effect when the NPS system is
stopped and restarted.
////////// NZSQL \? output: Note that lots of internal \ (slash) commands have a
corresponding nzsql - (dash) options at command line ///////////////////