Oracle

NEXTVAL and CURRVAL Pseudocolumns : Rules

Figo Kim 2006. 11. 25. 22:00

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 context:


  • The SELECT list of a view
  • A SELECT statement with the DISTINCT keyword
  • A SELECT statement with GROUP BY, HAVING, or ORDER BY clause
  • A subquery in a SELECT ,DELETE, or UPDATE statement
  • The DEFAULT expression in a CREATE TABLE or ALTER TABLE statement