Re: INSERT INTO TABLE that has mismatched structure.

From: Kevin <factor_at_mail.ru>
Date: 30 May 2002 18:04:10 -0700
Message-ID: <eb7b37e9.0205301704.60e87919_at_posting.google.com>


ed.prochak_at_alltel.com (Ed prochak) wrote in message news:<e51b160.0205300920.6756f964_at_posting.google.com>...
> factor_at_mail.ru (Kevin) wrote in message news:<eb7b37e9.0205291959.78779f1e_at_posting.google.com>...
> > Hello!
> >
> > I want to append records from one table to another, that contain more
> > fields.
> >
> > I try to make this:
> > INSERT INTO K_PR_ARX SELECT * FROM k_pr1000;
> >
> > and get this message: ORA-00947 not enough values.
> > This happened because the table k_pr1000 has got less fields than the
> > table K_PR_ARX. I think exist other way to make this thing (may be
> > hints, etc).
> >
> > Excuse me for my bad english.
> > Please help me.
> >
> > Kevin.
> > Russia.
>
>
> I would not use the * but list the columns explicitly. Then, just add
> NULL for each extra column. So assuming k_pr1000 has columns aa, bb,
> and cc and K_PR_ARX has columns aa, ab, ac, ad, and ae then try using:
>
> INSERT INTO K_PR_ARX SELECT aa, bb, cc, NULL, NULL FROM k_pr1000;

Ok, but i can't do this because in my case: Every time k_pr* (k_pr1000 for example) - can contain different quantity of columns.

Kevin. Received on Fri May 31 2002 - 03:04:10 CEST

Original text of this message