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: copy one table to an other

Re: copy one table to an other

From: Frank van Bortel <fvanbortel_at_netscape.net>
Date: Tue, 10 May 2005 14:28:54 +0200
Message-ID: <d5q968$4n3$1@news4.zwoll1.ov.home.nl>


Vince <vincent@ wrote:
> hi there!
> I have to copy data from one table to another..like this:
>
> insert into mytable2 select * from mytable1;
>
> but number of columns of mytable2 is greater than those of mytable1,
> so I get the : ORA-00947: not enough values
>
> is there any way to proceed without having to enumerate all the
> columns ?
> the column in plus is a ID column with an autoincrement (trigger)
> which is not in mytable1.
>
> thanks a lot :)
> ++
> Vince

That is not a copy, a copy would be:

Create table mytable2 as select * from myothertable;

CTAS (Create Table AS) in OracleSpeak :)

What you want is not a copy, and there's no other way then name the columns. Which is a Good Idea (tm) anyway.

-- 
Regards,
Frank van Bortel
Received on Tue May 10 2005 - 07:28:54 CDT

Original text of this message

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