General rules

Types and functions of the definition SQL

The definition SQL enables users to define and modify schemas and to define and delete tables, indexes, and privileges.

The following table lists the types and functions of definition SQL.

Table 3-1 Types and functions of definition SQL

TypeFunction
ALTER INDEX (Alter index definition)Changes the index name.
ALTER PROCEDURE (Re-create SQL object of procedure)Re-creates the SQL object of a procedure.
ALTER ROUTINE (Re-create SQL objects for functions, procedures, and triggers)Re-creates SQL objects for functions, procedures, and triggers.
ALTER TABLE (Alter table definition)
  • Adds a new column to the end of a base table.
  • Increases the maximum length of an existing column of the variable-length data type.
  • Changes data types.
  • Deletes a base table column that contains no data.
  • Changes the uniqueness constraint for cluster keys for a base table containing no data.
  • Renames tables and columns.
  • Assigns the updatable column attribute.
  • Changes the table to a falsification-prevented table.
  • Changes the partitioning storage condition for row partitioned tables and matrix partitioned tables.
ALTER TRIGGER (Re-create trigger SQL object)Re-creates a trigger SQL object.
COMMENT (Comment)Provides a comment in a table or column.
CREATE AUDIT (Define audit event)Defines audit events and their targets to be recorded as an audit trail.
CREATE CONNECTION SECURITY (Definition of the connection security facility)Defines security items related to the connection security facility.
CREATE FUNCTION (Define function)Defines a function.
CREATE PUBLIC FUNCTION (Define public function)Defines a public function.
CREATE INDEX (Define index)Defines an index (in ascending or descending order) for columns in a base table.
CREATE PROCEDURE (Define procedure)Defines a procedure.
CREATE PUBLIC PROCEDURE (Define public procedure)Defines a public procedure.
CREATE SCHEMA (Define schema)Defines a schema.
CREATE SEQUENCE (Define sequence generator)Defines a sequence generator.
CREATE TABLE (Define table)Defines a base table.
CREATE TRIGGER (Define trigger)Defines a trigger.
CREATE TYPE (Define type)Defines an abstract data type.
CREATE VIEW (Define view)Defines a view table.
CREATE PUBLIC VIEW (Define public view)Defines a public view.
DROP AUDIT (Delete audit event)Removes definitions that match the target audit events defined in CREATE AUDIT from being audited.
DROP CONNECTION SECURITY (Delete connection security facility)Deletes security items related to the connection security facility.
DROP DATA TYPE (Delete user-defined data type)Deletes an abstract data type.
DROP FUNCTION (Delete function)Deletes a function.
DROP PUBLIC FUNCTION (Delete public function)Deletes a public function.
DROP INDEX (Delete index)Deletes an index.
DROP PROCEDURE (Delete procedure)Deletes a procedure.
DROP PUBLIC PROCEDURE (Delete public procedure)Deletes a public procedure.
DROP SCHEMA (Delete schema)Deletes a schema.
DROP SEQUENCE (Delete sequence generator)Deletes a sequence generator.
DROP TABLE (Delete table)Deletes a base table, as well as any indexes, comments, access privileges, and view tables associated with the base table.
DROP TRIGGER (Delete trigger)Deletes a trigger.
DROP VIEW (Delete view table)Deletes a view table.
DROP PUBLIC VIEW (Delete public view)Deletes a public view.
GRANT CONNECT (Grant CONNECT privilege)Grants the CONNECT privilege to users.
GRANT DBA (Grant DBA privilege)Grants the DBA privilege to users.
GRANT RDAREA (Grant RDAREA usage privilege)Grants the RDAREA usage privilege to users.
GRANT SCHEMA (Grant schema definition privilege)Grants the schema definition privilege to users.
GRANT access privilege (Grant access privileges)Grants access privileges to users.
GRANT AUDIT (Change auditor password)Changes the auditor's password.
REVOKE CONNECT (Revoke CONNECT privilege)Revokes previously granted CONNECT privileges.
REVOKE DBA (Revoke DBA privilege)Revokes previously granted DBA privileges.
REVOKE RDAREA (Revoke RDAREA usage privilege)Revokes previously granted RDAREA usage privileges.
REVOKE SCHEMA (Revoke schema definition privilege)Revokes previously granted schema definition privileges.
REVOKE access privilege (Revoke access privileges)Revokes previously granted access privileges.

Common rules

Upon normal execution of a definition SQL statement, a COMMIT is made simultaneously with the completion of the processing.

Notes

A definition SQL cannot be specified from an X/Open-compliant UAP running under OLTP.