IBM Books

SQL Reference


Chapter 6. Statements

This chapter contains syntax diagrams, semantic descriptions, rules, and examples of the use of the SQL statements.

Table 18. SQL Statements
SQL Statement Function Page
ALTER BUFFERPOOL Changes the definition of a buffer pool. ALTER BUFFERPOOL
ALTER NICKNAME Changes the definition of a nickname. ALTER NICKNAME
ALTER NODEGROUP Changes the definition of a nodegroup. ALTER NODEGROUP
ALTER SERVER Changes the definition of a server. ALTER SERVER
ALTER TABLE Changes the definition of a table. ALTER TABLE
ALTER TABLESPACE Changes the definition of a table space. ALTER TABLESPACE
ALTER TYPE (Structured) Changes the definition of a structured type. ALTER TYPE (Structured)
ALTER USER MAPPING Changes the definition of a user authorization mapping. ALTER USER MAPPING
ALTER VIEW Changes the definition of a view by altering a reference type column to add a scope. ALTER VIEW
BEGIN DECLARE SECTION Marks the beginning of a host variable declaration section. BEGIN DECLARE SECTION
CALL Calls a stored procedure. CALL
CLOSE Closes a cursor. CLOSE
COMMENT ON Replaces or adds a comment to the description of an object. COMMENT ON
COMMIT Terminates a unit of work and commits the database changes made by that unit of work. COMMIT
Compound SQL Combines one or more other SQL statements into an executable block. Compound SQL
CONNECT (Type 1) Connects to an application server according to the rules for remote unit of work. CONNECT (Type 1)
CONNECT (Type 2) Connects to an application server according to the rules for application-directed distributed unit of work. CONNECT (Type 2)
CREATE ALIAS Defines an alias for a table, view, or another alias. CREATE ALIAS
CREATE BUFFERPOOL Creates a new buffer pool. CREATE BUFFERPOOL
CREATE DISTINCT TYPE Defines a distinct data type. CREATE DISTINCT TYPE
CREATE EVENT MONITOR Specifies events in the database to monitor. CREATE EVENT MONITOR
CREATE FUNCTION Registers a user-defined function. CREATE FUNCTION
CREATE FUNCTION (External Scalar) Registers a user-defined external scalar function. CREATE FUNCTION (External Scalar)
CREATE FUNCTION (External Table) Registers a user-defined external table function. CREATE FUNCTION (External Table)
CREATE FUNCTION (Source or Template) Registers a user-defined sourced function. CREATE FUNCTION (Source or Template)
CREATE FUNCTION MAPPING Define a function mapping. CREATE FUNCTION MAPPING
CREATE INDEX Defines an index on a table. CREATE INDEX
CREATE NICKNAME Defines a nickname. CREATE NICKNAME
CREATE PROCEDURE Registers a stored procedure. CREATE PROCEDURE
CREATE SCHEMA Defines a schema. CREATE SCHEMA
CREATE SERVER Defines a data source to a federated database. CREATE SERVER
CREATE TABLE Defines a table. CREATE TABLE
CREATE TABLESPACE Defines a table space. CREATE TABLESPACE
CREATE TRIGGER Defines a trigger. CREATE TRIGGER
CREATE TYPE (Structured) Defines a structured data type. CREATE TYPE (Structured)
CREATE TYPE MAPPING Defines a mapping between data types. CREATE TYPE MAPPING
CREATE USER MAPPING Defines a mapping between user authorizations. CREATE USER MAPPING
CREATE VIEW Defines a view of one or more table, view or nickname. CREATE VIEW
CREATE WRAPPER Register a wrapper. CREATE WRAPPER
DECLARE CURSOR Defines an SQL cursor. DECLARE CURSOR
DELETE Deletes one or more rows from a table. DELETE
DESCRIBE Describes the result columns of a prepared SELECT statement. DESCRIBE
DISCONNECT Terminates one or more connections when there is no active unit of work. DISCONNECT
DROP Deletes objects in the database. DROP
END DECLARE SECTION Marks the end of a host variable declaration section. END DECLARE SECTION
EXECUTE Executes a prepared SQL statement. EXECUTE
EXECUTE IMMEDIATE Prepares and executes an SQL statement. EXECUTE IMMEDIATE
EXPLAIN Captures information about the chosen access plan. EXPLAIN
FETCH Assigns values of a row to host variables. FETCH
FLUSH EVENT MONITOR Writes out the active internal buffer of an event monitor. FLUSH EVENT MONITOR
FREE LOCATOR Removes the association between a locator variable and its value. FREE LOCATOR
GRANT (Database Authorities) Grants authorities on the entire database. GRANT (Database Authorities)
GRANT (Index Privileges) Grants the CONTROL privilege on indexes in the database. GRANT (Index Privileges)
GRANT (Package Privileges) Grants privileges on packages in the database. GRANT (Package Privileges)
GRANT (Schema Privileges) Grants privileges on a schema. GRANT (Schema Privileges)
GRANT (Server Privileges) Grants privileges to query a specific data source. GRANT (Server Privileges)
GRANT (Table, View, or Nickname Privileges) Grants privileges on tables, views and nicknames. GRANT (Table, View, or Nickname Privileges)
INCLUDE Inserts code or declarations into a source program. INCLUDE
INSERT Inserts one or more rows into a table. INSERT
LOCK TABLE Either prevents concurrent processes from changing a table or prevents concurrent processes from using a table. LOCK TABLE
OPEN Prepares a cursor that will be used to retrieve values when the FETCH statement is issued. OPEN
PREPARE Prepares an SQL statement (with optional parameters) for execution. PREPARE
REFRESH TABLE Refreshes the data in a summary table. REFRESH TABLE
RELEASE Places one or more connections in the release-pending state. RELEASE
RENAME TABLE Renames an existing table. RENAME TABLE
REVOKE (Database Authorities) Revokes authorities from the entire database. REVOKE (Database Authorities)
REVOKE (Index Privileges) Revokes the CONTROL privilege on given indexes. REVOKE (Index Privileges)
REVOKE (Package Privileges) Revokes privileges from given packages in the database. REVOKE (Package Privileges)
REVOKE (Schema Privileges) Revokes privileges on a schema. REVOKE (Schema Privileges)
REVOKE (Server Privileges) Revokes privileges to query a specific data source. REVOKE (Server Privileges)
REVOKE (Table, View, or Nickname Privileges) Revokes privileges from given tables, views or nicknames. REVOKE (Table, View, or Nickname Privileges)
ROLLBACK Terminates a unit of work and backs out the database changes made by that unit of work. ROLLBACK
SELECT INTO Specifies a result table of no more than one row and assigns the values to host variables. SELECT INTO
SET CONNECTION Changes the state of a connection from dormant to current, making the specified location the current server. SET CONNECTION
SET CURRENT DEGREE Changes the value of the CURRENT DEGREE special register. SET CURRENT DEGREE
SET CURRENT EXPLAIN MODE Changes the value of the CURRENT EXPLAIN MODE special register. SET CURRENT EXPLAIN MODE
SET CURRENT EXPLAIN SNAPSHOT Changes the value of the CURRENT EXPLAIN SNAPSHOT special register. SET CURRENT EXPLAIN SNAPSHOT
SET CURRENT PACKAGESET Sets the schema name for package selection. SET CURRENT PACKAGESET
SET CURRENT QUERY OPTIMIZATION Changes the value of the CURRENT QUERY OPTIMIZATION special register. SET CURRENT QUERY OPTIMIZATION
SET CURRENT REFRESH AGE Changes the value of the CURRENT REFRESH AGE special register. SET CURRENT REFRESH AGE
SET EVENT MONITOR STATE Activates or deactivates an event monitor. SET EVENT MONITOR STATE
SET INTEGRITY Sets the check pending state and checks data for constraint violations. SET INTEGRITY
SET PASSTHRU Opens a session for submitting a data source's native SQL directly to the data source. SET PASSTHRU
SET PATH Changes the value of the CURRENT PATH special register. SET PATH
SET SCHEMA Changes the value of the CURRENT SCHEMA special register. SET SCHEMA
SET SERVER OPTION Sets server option settings. SET SERVER OPTION
SET transition-variable Assigns values to NEW transition variables. SET transition-variable
SIGNAL SQLSTATE Signals an error. SIGNAL SQLSTATE
UPDATE Updates the values of one or more columns in one or more rows of a table. UPDATE
VALUES INTO Specifies a result table of no more than one row and assigns the values to host variables. VALUES INTO
WHENEVER Defines actions to be taken on the basis of SQL return codes. WHENEVER


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]