Oracle8i SQL Reference Release 3 (8.1.7) Part Number A85397-01 |
|
SQL Statements:
DROP SEQUENCE to UPDATE, 17 of 27
Use the RENAME
statement to rename a table, view, sequence, or private synonym for a table, view, or sequence.
Do not use this statement to rename public synonyms. Instead, drop the public synonym and then create another public synonym with the new name.
The object must be in your own schema.
old
Specify the name of an existing table, view, sequence, or private synonym.
new
Specify the new name to be given to the existing object. The new name must not already be used by another schema object in the same namespace and must follow the rules for naming schema objects.
To change the name of table dept
to emp_dept
, issue the following statement:
RENAME dept TO emp_dept;
You cannot use this statement directly to rename columns. However, you can rename a column using this statement together with the CREATE
TABLE
statement with AS
subquery
. The following statements re-create the table static
, renaming a column from oldname
to newname
:
CREATE TABLE temporary (newname, col2, col3) AS SELECT oldname, col2, col3 FROM static; DROP TABLE static; RENAME temporary TO static;
|
![]() Copyright © 1996-2000, Oracle Corporation. All Rights Reserved. |
|