At 12:53 PM +0800 10/3/01, chong wee siong wrote:
>Hi DBAs:
> I want to copy TableA in DatabaseA to TableB in DatabaseB
>with changes in the attributes of the tables, what options do I have?
>
>I tried these:
>
>a) insert into TableB (id) select (id) from DatabaseA.TableA;
>this works
>b) insert into TableB (id,data) select (id,data) from DatabaseA.TableA;
>but this does not work, why? and how do I do this?
They syntax is illegal for your second attempt. The column list for
the SELECT part shouldn't have parentheses around it:
insert into TableB (id,data) select id,data from DatabaseA.TableA;
Parentheses work in your first attempt because (id) is a simple
parenthesized expression that produces id as its value.
--
Paul DuBois, paul@stripped
| Thread |
|---|
| • "\n" is SLASH, N instead of <newline> | Uriel Wittenberg | 2 Oct |
| • Re: "\n" is SLASH, N instead of <newline> | Benjamin Pflugmann | 2 Oct |
| • Re: "\n" is SLASH, N instead of <newline> | Uriel Wittenberg | 2 Oct |
| • Re: "\n" is SLASH, N instead of <newline> | Benjamin Pflugmann | 2 Oct |
| • Re: "\n" is SLASH, N instead of <newline> | Gerald Clark | 2 Oct |
| • Re: "\n" is SLASH, N instead of <newline> | Uriel Wittenberg | 3 Oct |
| • Re: "\n" is SLASH, N instead of <newline> | Benjamin Pflugmann | 3 Oct |
| • INSERT INTO SELECT ?? | chong wee siong | 3 Oct |
| • Re: INSERT INTO SELECT ?? | Paul DuBois | 3 Oct |
| • Re: "\n" is SLASH, N instead of <newline> -- SOLUTION (why not mention it?) | Uriel Wittenberg | 4 Oct |
| • Re: "\n" is SLASH, N instead of <newline> -- SOLUTION (why not mention it?) | Benjamin Pflugmann | 4 Oct |
| • Re: "\n" is SLASH, N instead of <newline> -- SOLUTION (why not mention it?) | Uriel Wittenberg | 4 Oct |
| • Re: "\n" is SLASH, N instead of <newline> -- SOLUTION (why not mention it?) | Benjamin Pflugmann | 4 Oct |