Statements

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

Table 20. SQL Statements
SQL Statement Function
ALTER TABLE Alters the description of a table
BEGIN DECLARE SECTION Marks the beginning of an SQL declare section
CALL Calls a procedure
CLOSE Closes a cursor
COMMENT ON Replaces or adds a comment to the description of an alias, column, function, index, package, parameter, procedure, table, type or view
COMMIT Ends a unit of work and commits the database changes made by that unit of work
CONNECT (Type 1) Connects to an application server and establishes the rules for remote unit of work
CONNECT (Type 2) Connects to an application server and establishes the rules for application-directed distributed unit of work
CREATE ALIAS Creates an alias
CREATE COLLECTION Creates a collection
CREATE DISTINCT TYPE Creates a distinct type (user-defined type)
CREATE FUNCTION Creates a user-defined function
CREATE FUNCTION (Scalar) Creates either an external function or an SQL scalar function
CREATE FUNCTION (Sourced) Creates a user-defined function based on another existing scalar or column function
CREATE INDEX Creates an index on a table
CREATE PROCEDURE Creates an external procedure or an SQL procedure.
CREATE SCHEMA Creates a collection and a set of objects in that collection
CREATE TABLE Creates a table
CREATE VIEW Creates a view of one or more tables or views
DECLARE CURSOR Defines an SQL cursor
DECLARE PROCEDURE Defines an external procedure
DECLARE STATEMENT Declares the names used to identify prepared SQL statements
DECLARE VARIABLE Declares a subtype or CCSID other than the default for a host variable
DELETE Deletes one or more rows from a table
DESCRIBE Describes the result columns of a prepared statement
DESCRIBE TABLE Obtains information about a table or view
DISCONNECT Immediately ends one or more connections
DROP Deletes a collection, index, package, procedure, table, or view
END DECLARE SECTION Marks the end of an SQL declare section
EXECUTE Executes a prepared SQL statement
EXECUTE IMMEDIATE Prepares and executes an SQL statement
FETCH Positions a cursor on a row of the result table; can also assign values from one or more rows of the result table to host variables
FREE LOCATOR Removes the association between a LOB locator variable and its value
GET DIAGNOSTICS Returns information about the previous SQL statement that was executed.
GRANT (Function or Procedure Privileges) Grants privileges on a function or procedure
GRANT (Package Privileges) Grants privileges on a package
GRANT (Table Privileges) Grants privileges on a table or view
GRANT (User-Defined Type Privileges) Grants privileges on a user-defined type
INCLUDE Inserts declarations into a source program
INSERT Inserts one or more rows into a table
LABEL ON Replaces or adds a label on the description of an alias, column, package, table, or view
LOCK TABLE Either prevents concurrent processes from changing a table or prevents concurrent processes from using a table
OPEN Opens a cursor
PREPARE Prepares an SQL statement for execution
RELEASE Places one or more connections in the release-pending state
RENAME Renames a table, view, or index.
REVOKE (Function or Procedure Privileges) Revokes privileges on a function or procedure
REVOKE (Package Privileges) Revokes the privilege to execute statements in a package
REVOKE (Table Privileges) Revokes privileges on a table or view
REVOKE (User-Defined Type Privileges) Revokes the privilege to use a user-defined type
ROLLBACK Ends a unit of work and backs out the database changes made by that unit of work
SELECT INTO Assigns values to host variables
SET CONNECTION Establishes the application server of the process by identifying one of its existing connections
SET OPTION Establishes the options for processing SQL statements
SET PATH Assigns a value to the CURRENT PATH special register
SET RESULT SETS Identifies the result sets in a procedure
SET TRANSACTION Changes the isolation level for the current unit of work
SET variable Specifies a result table of no more than one row and assigns the values to host variables.
UPDATE Updates the values of one or more columns in one or more rows of a table
VALUES INTO Specifies a result table of no more than one row and assigns the values to host variables.
WHENEVER Defines actions to be taken on the basis of SQL return codes


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