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: match columns on insert sub select

Re: match columns on insert sub select

From: Umberto Quaia <umberto..quaia_at_tin.it>
Date: Sun, 3 Aug 2003 13:30:54 +0200
Message-ID: <bgirvd$p2gdv$1@ID-163428.news.uni-berlin.de>


Unfortunately, there is not yet such an instruction.

I agree with you that it would be very useful.

I don't understand Erik's objection about adding a column in source table.
If that column is not in dest table, it's simply not copied.

The objection should be instead on dropping a column in source table. But in this case simply NULL may be inserted.

So, for me it would be just very useful. I don't see any counter-indication in such an instruction.

Umberto

"Dan." <dan_at_nospam.edu> wrote in message news:bgbj69$eok$1_at_news.Stanford.EDU...
> Anyone know of an easy way to copy data from table to table that
will match
> up exact same named columns from the source to the target?
>
>
> TABLE1 (source)
>
> FIELDA
> FIELDB
> FIELDC
> FIELDD
>
>
>
> TABLE2 (target)
>
> FIELDB
> FIELDA
> FIELDD
> FIELDC
> FIELDE
> FIELDF
> FIELDG
>
>
> A script would work but ideally it would be a keyword so you could
do
> something like this?
>
> INSERT INTO TABLE2
> (SELECT MATCHING * FROM TABLE1)
> -----------------
>
> instead of having to write out
>
> INSERT INTO TABLE2
> (SELECT
> FIELDB
> FIELDA
> FIELDD
> FIELDC
> '',
> '',
> ''
> FROM TABLE1)
>
>
> Thanks for any responses, -Dan
>
>
Received on Sun Aug 03 2003 - 06:30:54 CDT

Original text of this message

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