Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: How to create a duplicate of a table without copying the data

Re: How to create a duplicate of a table without copying the data

From: Jonathan Gennick <gennick_at_worldnet.att.net>
Date: 5 Sep 1998 23:35:01 GMT
Message-ID: <35f6a781.1732405@netnews.worldnet.att.net>


On 4 Sep 1998 23:34:19 GMT, "Vishy Ram" <vram_at_interaccess.com> wrote:

>I am trying to create a temptable which is a duplicate of an existing
>table. However
>I do not want any data from the master. Just the table definition of the
>master. So I
>cannot use the Create Table as Select clause. Can anyone suggest a better
>way.

This just occurred to me, and I havn't tested it.

create duplicate_table as
select * from original_table
where 2 = 3;

I also believe it will force a full tablescan of the original table, so be careful. The where condition should never be satisfied, so no rows will go to the new table from the old.

regards,

Jonathan Received on Sat Sep 05 1998 - 18:35:01 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US