Home > Database > Mysql Tutorial > How to Create an Empty Table Copy with the Same Structure as an Existing Oracle Table?

How to Create an Empty Table Copy with the Same Structure as an Existing Oracle Table?

Patricia Arquette
Release: 2025-01-01 10:40:11
Original
386 people have browsed it

How to Create an Empty Table Copy with the Same Structure as an Existing Oracle Table?

Creating a Table Copy without Data in Oracle

Question:

How can I create an exact copy of an Oracle table structure without duplicating the underlying data?

Answer:

To create a table copy with the same structure but no data, you can use the following statement:

create table xyz_new as select * from xyz where 1=0;
Copy after login

Limitations:

This method does not copy the following elements to the new table:

  • Sequences
  • Triggers
  • Indexes
  • Some constraints
  • Materialized view logs

Additionally, it does not handle partitions.

The above is the detailed content of How to Create an Empty Table Copy with the Same Structure as an Existing Oracle Table?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template