TestingDocs.com
Software Testing website
  • Automation
    • Selenium
    • JBehave Framework
  • Tutorials
    • MySQL Tutorials
    • Testlink
    • Maven
    • Git
  • IDEs
    • IntelliJ IDEA
    • Eclipse
  • Flowcharts
    • Flowgorithm
    • Raptor
  • About

Oracle

Oracle Rename Table Statement

Overview

Let’s learn the rename table statement in the Oracle database. This command is used to rename an existing table name to a new name in the database. The new name of the table should be different from the existing table names.

When we rename a table, Oracle invalidates all objects that depend on the old table and all the objects are transferred to the new table.

Rename

The syntax for the rename table SQL statement:

SQL> RENAME <existing_table_name> TO <new_table_name>;

Example

For example, we have an existing database table emp. We would like to rename the table name to the new name: employee

SQL> RENAME emp TO employee;

Example: Using existing table name

We cannot use the same name for the new table or any existing table name in the database. We get the following error:

ERROR at line 1:
ORA-00955: name is already used by an existing object

 

—

Oracle Database Tutorials on this website:

https://www.testingdocs.com/oracle-database-tutorials-for-beginners/

More information about Oracle Database:

https://www.oracle.com/database/

Related Posts

Oracle /

Download Oracle SQL Developer

Oracle /

Install Oracle 19c Database On Windows 10

Oracle /

Fix ORA-01109: database not open Error

Oracle /

Oracle SQL Update Statement

Oracle /

Oracle SQL INSERT Statement

‹ Oracle SQL Data Types› Oracle SQL BETWEEN Operator with Examples

Recent Posts

  • Scaler Academy – An Online Learning Platform
  • Difference between PHP and JavaScript?
  • MS Access Data Types
  • Install RAPTOR Avalonia on CentOS
  • Download RAPTOR Avalonia Edition on Windows
  • npm doctor command
  • Build & Run CLion Project
  • Create New CLion C Project on Windows
  • Configure CLion Toolchains on Windows
  • Launch CLion IDE on Windows

Back to Top

Links

  • Contact
  • Privacy Policy
  • Cookie Policy

www.TestingDocs.com