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: Oracle SQL creating table as a copy of table

Re: Oracle SQL creating table as a copy of table

From: <Kenneth>
Date: Sun, 17 Apr 2005 17:55:00 GMT
Message-ID: <4262a2c8.1132140@news.inet.tele.dk>


On Sun, 17 Apr 2005 19:37:56 +0200, =?iso-8859-2?Q?Pawe=B3?= <pmg3REMOVETHIS_at_op.pl> wrote:

>Good evening everybody (GMT+1)
>Let's say I have a table called 'employees' and I need to create an
>identical table for retired contractors - 'contractors'.
>So what I do is:
>1) CREATE table contractors AS SELECT * FROM EMPLOYEES;
>2) TRUNCATE TABLE CONTRACTORS;
>
>This seems to be a severe abuse of system resources cause I copy a
>significant amount of data, just to delete it in the very next line and to
>keep only the structure.
>
>Is there any smarter way to perform this task?
>
>Thank you,
>Paweł Gałecki

CREATE table contractors AS SELECT * FROM EMPLOYEES where 0 = 1;

Received on Sun Apr 17 2005 - 12:55:00 CDT

Original text of this message

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