Is there a simple method to copy its structure—but not its data—into another table with the same name? In order to conduct various tasks on it, I basically want to build a table with the same structure but a different name.
top of page
To see this working, head to your live site.
Oracle Database clone the structure of a table.
Oracle Database clone the structure of a table.
2 answers0 replies
Like
2 Comments
bottom of page
To discover the precise DDL to rebuild the table, including the storage clause, use the following procedure:
select dbms_metadata.get_ddl('TABLE', 'TABLE_NAME', 'SCHEMA_NAME') from dual;
Or the easiest way to achieve it is by using where 1=2
CREATE TABLE TARGET_TABLE_NAME AS SELECT * FROM SOURCE_TABLE WHERE 1-2;