Re: INSERT INTO STATEMENT

From: Martin Doherty <martin.doherty_at_elcaro.moc>
Date: Wed, 13 Nov 2002 18:07:27 -0800
Message-ID: <jDDA9.10$FE.235_at_news.oracle.com>


Hi Paul,

Whenever you post a question, please remember to include the version number of Oracle RDBMS, + details of any tools you are using (if applicable). Also if you're getting an error, please paste the error message text into your post.

Your first statement is almost correct but you are missing the FROM clause that names the table you are selecting from.

As for statement #2, I'm not sure it is possible to put a SELECT inside a VALUES clause (of course, the SQL language keeps expanding with every new release of Oracle, again underlining the need to state which version you are using).

hth
Martin

P.S. I was trying to think of some word play on Robbing Peta To Pay Paul but came up short.

Peta Griffith wrote:

>Hi All,
>
>I am have trouble coding a Insert Into Statement
>
>the below statements is basic example of the SQL
>
>INSERT INTO TEST1 ( ID,DESCRIPTION) SELECT TEST.ID,TEST.DESCRIPTION WHERE
>TEST.ID =5
>
>INSERT INTO TEST1 ( ID,DESCRIPTION) VALUES(SELECT TEST.ID,TEST.DESCRIPTION
>WHERE TEST.ID =5)
>
>
>i am trying to copy the detail from on table to another with exact
>structures
>if anyone knows the correct syntax or a better method for this it would be
>much appreciated
>
>Cheers
>Paul
>
>
>
>
Received on Thu Nov 14 2002 - 03:07:27 CET

Original text of this message