Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Semestr2 / 1 - Oracle / Oracle selected docs / SQL reference.pdf
Скачиваний:
24
Добавлен:
12.05.2015
Размер:
11.92 Mб
Скачать

9

SQL Statements: ALTER CLUSTER to ALTER SEQUENCE

This chapter lists the various types of SQL statements and then describes the first set (in alphabetical order) of SQL statements. The remaining SQL statements appear in alphabetical order in Chapter 10 through Chapter 18.

This chapter contains the following sections:

Types of SQL Statements

Organization of SQL Statements

ALTER CLUSTER

ALTER DATABASE

ALTER DIMENSION

ALTER FUNCTION

ALTER INDEX

ALTER INDEXTYPE

ALTER JAVA

ALTER MATERIALIZED VIEW ALTER MATERIALIZED VIEW LOG ALTER OPERATOR

ALTER OUTLINE

ALTER PACKAGE

ALTER PROCEDURE

ALTER PROFILE

ALTER RESOURCE COST

ALTER ROLE

ALTER ROLLBACK SEGMENT ALTER SEQUENCE

SQL Statements: ALTER CLUSTER to ALTER SEQUENCE 9-1

Types of SQL Statements

Types of SQL Statements

The tables in the following sections provide a functional summary of SQL statements and are divided into these categories:

Data definition language (DDL) statements

Data manipulation language (DML) statements

Transaction control statements

Session control statements

System control statements

Data Definition Language (DDL) Statements

Data definition language (DDL) statements enable you to perform these tasks:

Create, alter, and drop schema objects

Grant and revoke privileges and roles

Analyze information on a table, index, or cluster

Establish auditing options

Add comments to the data dictionary

The CREATE, ALTER, and DROP commands require exclusive access to the specified object. For example, an ALTER TABLE statement fails if another user has an open transaction on the specified table.

The GRANT, REVOKE, ANALYZE, AUDIT, and COMMENT commands do not require exclusive access to the specified object. For example, you can analyze a table while other users are updating the table.

Oracle implicitly commits the current transaction before and after every DDL statement.

Many DDL statements may cause Oracle to recompile or reauthorize schema objects. For information on how Oracle recompiles and reauthorizes schema objects and the circumstances under which a DDL statement would cause this, see Oracle9i Database Concepts.

DDL statements are supported by PL/SQL with the use of the DBMS_SQL package.

See Also: Oracle9i Supplied PL/SQL Packages and Types Reference

9-2 Oracle9i SQL Reference

Types of SQL Statements

The DDL statements are:

ALTER ... (All statements beginning with ALTER)

ANALYZE

ASSOCIATE STATISTICS

AUDIT

COMMENT

CREATE ... (All statements beginning with CREATE)

DISASSOCIATE STATISTICS

DROP ... (All statements beginning with DROP)

GRANT

NOAUDIT

RENAME

REVOKE

TRUNCATE

Data Manipulation Language (DML) Statements

Data manipulation language (DML) statements query and manipulate data in existing schema objects. These statements do not implicitly commit the current transaction. The data manipulation language statements are:

CALL

DELETE

EXPLAIN PLAN

INSERT

LOCK TABLE

MERGE

SELECT

UPDATE

The CALL and EXPLAIN PLAN statements are supported in PL/SQL only when executed dynamically. All other DML statements are fully supported in PL/SQL.

Transaction Control Statements

Transaction control statements manage changes made by DML statements. The transaction control statements are:

COMMIT

ROLLBACK

SAVEPOINT

SET TRANSACTION

SQL Statements: ALTER CLUSTER to ALTER SEQUENCE 9-3

Organization of SQL Statements

All transaction control statements, except certain forms of the COMMIT and ROLLBACK commands, are supported in PL/SQL. For information on the restrictions, see COMMIT on page 12-75 and ROLLBACK on page 17-99.

Session Control Statements

Session control statements dynamically manage the properties of a user session. These statements do not implicitly commit the current transaction.

PL/SQL does not support session control statements. The session control statements are:

ALTER SESSION

SET ROLE

System Control Statement

The single system control statement, ALTER SYSTEM, dynamically manages the properties of an Oracle instance. This statement does not implicitly commit the current transaction and is not supported in PL/SQL.

Embedded SQL Statements

Embedded SQL statements place DDL, DML, and transaction control statements within a procedural language program. Embedded SQL is supported by the Oracle precompilers and is documented in the following books:

Pro*COBOL Precompiler Programmer’s Guide

Pro*C/C++ Precompiler Programmer’s Guide

SQL*Module for Ada Programmer’s Guide

Organization of SQL Statements

All SQL statements in this chapter, as well as in Chapters 10 through 18, are organized into the following sections:

Syntax The syntax diagrams show the keywords and parameters that make up the statement.

9-4 Oracle9i SQL Reference

Organization of SQL Statements

Caution: Not all keywords and parameters are valid in all circumstances. Be sure to refer to the "Semantics" section of each statement and clause to learn about any restrictions on the syntax.

Purpose The "Purpose" section describes the basic uses of the statement.

Prerequisites The "Prerequisites" section lists privileges you must have and steps that you must take before using the statement. In addition to the prerequisites listed, most statements also require that the database be opened by your instance, unless otherwise noted.

Semantics The "Semantics" section describes the purpose of the keywords, parameter, and clauses that make up the syntax, as well as restrictions and other usage notes that may apply to them. (The conventions for keywords and parameters used in this chapter are explained in the Preface of this reference.)

Examples The "Examples" section shows how to use the various clauses and parameters of the statement.

SQL Statements: ALTER CLUSTER to ALTER SEQUENCE 9-5

Соседние файлы в папке Oracle selected docs