Search code examples
oracle-databaseora-00907

ora -00907 -missing right parenthesis


I have a requirement to insert certain columns from one table to another in oracle. It would be like below

insert into table2 (column1,column2,.....,columnn)     
select  (column1,column2,.....,columnn)     
from table1      
where condition;

But I am getting

'ORA - 00907 missing right parenthesis error'

in the select statement itself.

I am executing the select statement separately and still getting the

'ora -00907 missing right parenthesis'

error.

Any suggestion for correcting the above would be helpful.

Thanks in advance


Solution

  • I'm not sure that placing the entire select clause inside parentheses is valid. I would have written your query as:

    INSERT INTO table2 (column1, column2, ..., columnN)
    SELECT column1, column2, ..., columnN
    FROM table1
    WHERE <condition>;