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: Thomas Kellerer <NNGNVRDSJEBN_at_spammotel.com>
Date: Mon, 18 Apr 2005 20:57:21 +0200
Message-ID: <d40vui$9mh$1@svr7.m-online.net>


Paweł wrote on 17.04.2005 19:37:
> 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?

I usually create a copy of the original SQL script for the employees table, modify that and use it to create the new table :)

Thomas Received on Mon Apr 18 2005 - 13:57:21 CDT

Original text of this message

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