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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Copy a record from 1-table to another

Re: Copy a record from 1-table to another

From: Jim Kennedy <kennedy-downwithspammersfamily_at_attbi.net>
Date: Wed, 14 Dec 2005 19:52:11 -0800
Message-ID: <j7adnXaLtL6cdT3enZ2dnUVZ_tydnZ2d@comcast.com>

"JoeT" <trubisz_at_yahoo.com> wrote in message news:1134615581.507689.266780_at_g43g2000cwa.googlegroups.com...
> TOAD won't work because this will have to run in the middle of the
> night from a shell script.
> I can't see how the first part of this response is will solve the
> problem.
>
> I have data in one table that all I want to do is move to another table
> and add 3-additional fields.
> Perhaps bulk collect/insert will work, but I have been unable to make
> it work given the documentation and examples I have found so far.
>
> Thanks anyway.
>
> Joe
>
>
> Sybrand Bakker wrote:
> > On 14 Dec 2005 14:43:47 -0800, "JoeT" <trubisz_at_yahoo.com> wrote:
> >
> > >All I want to do is copy R (which is over 200 attributes) to S which is
> > >the same structure with 3-additional attributes, and populate the
> > >3-attributes when I do this.
> >
> > And this requires only a little cutting and pasting...
> >
> > just
> > spool x
> > desc r
> > spool off
> > edit x and transform it into s
> > OR
> > Use Toad, select all columns, right click and generate an INSERT
> > statement.
> > Your solution is a *disaster* in terms of performance as you are
> > fetching record for record. You would at least need to do a BULK
> > COLLECT and BULK INSERT,
> > and coding that is WAY MORE WORK than
> > INSERT SELECT
> >
> > Geeez, don't people learn to WORK anymore nowadays?
> > It sure looks like!!
> >
> > --
> > Sybrand Bakker, Senior Oracle DBA
>

It is an easy script. There is no need to use pl/sql; it will be a lot slower than just issuing the sql statement. It is also pretty easy to put it in a dbms_job and have it run whenever you want. Jim Received on Wed Dec 14 2005 - 21:52:11 CST

Original text of this message

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