Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Insert Statement
Thanks for giving the time to answer this question. I must of had a bad
day. The following worked when I got home
insert into b select * from a;
Thanks again
regards
Tony
"sjacek" <member29683_at_dbforums.com> wrote in message
news:3296019.1062083663_at_dbforums.com...
>
> It means that table B has more columns that table A.
>
> Try this:
>
>
>
> insert into B (col1,col2,.....,coln) select col1,col2,....,coln from A;
>
>
>
> where col1 to coln are names of the columns in the tables.
>
>
>
> Or post definition of the tables, maybe I could spot the difference.
>
>
>
> Cheers,
>
>
>
> Jacek
>
>
>
> Originally posted by Tony Rees
>
> > Thanks for the suggestion. I tried this and it did not work. It
> > came back
>
> > with an ora-00947 Not enough values
>
> >
>
> > cheers
>
> >
>
> > Tony
>
> >
>
> > "sjacek" <member29683_at_dbforums.com> wrote in message
>
> > news:3295459.1062077864_at_dbforums.com"]news:3295459.1062077864_at_d-
> > bforums.com[/url]...
>
> > > insert into B select * from A;
>
> > > Originally posted by Tony Rees
>
> > > > Dear All,
>
> > > >
>
> > > > Can anyone provide the insert statement for me to allow me to
> > copy
>
> > > > data from
>
> > > > table A to table B.
>
> > > >
>
> > > > ie select into A as select * from B (or something
> > similar)
>
> > > >
>
> > > > I know that I can do the following
>
> > > >
>
> > > > create table B as select * from A
>
> > > >
>
> > > > but this is not what I want to do. Both tables have exactly
> > the same
>
> > > > structure. Table B is truncated as part of the process
> > thus
>
> > > > hanging on to
>
> > > > it's indexs and other objects
>
> > > >
>
> > > > Appreciate help
>
> > > >
>
> > > > regards
>
> > > >
>
> > > > Tony Rees
>
> > > tony_rees_at_stratexnet.com
>
> > > --
>
> > Posted via
> http://dbforums.com/http://dbforums.com
>
>
>
> --
> Posted via http://dbforums.com
Received on Thu Aug 28 2003 - 18:08:35 CDT
![]() |
![]() |