Rules for Using NEXTVAL and CURRVAL
You can use NEXTVAL and CURRVAL in the following contexts:
The SELECT list of a SELECT statement that is not part of a subquery
The SELECT list of a subquery in an INSERT statement
The VALUES clause of an INSERT statement
The SET clause of an UPDATE statement
You cannot use NEXTVAL and CURRVAL in the following contexts:
The SELECT list of a view
A SELECT statement with the DISTINCT keyword
A SELECT statement with GROUP BY, HAVING or ORDER BY clauses
A subquery in a SELECT, DELETE or UPDATE statement
The DEFAULT expression in a CREATE TABLE or ALTER TABLE statement
Types of indexes
Two types of indexes can be created. One type is a unique index: the Oracle Server automatically creates this index when you define a column in a table to have a PRIMARY KEY or a UNIQUE key constraint. The name of the index is the name given to the constraint.
The other type of index is a nonunique index, which a user can create. For example, you can create a FOREIGN KEY column index for a join in a query to improve retrieval speed
阅读(2237) | 评论(0) | 转发(0) |