5 Replies Latest reply on Mar 31, 2011 10:26 AM by castorp

    SQL Error: ORA-00947 while using INSERT INTO

    Sedso
      Hello,

      I am working with an INSERT INTO statement which returns ORA-00947.

      INSERT INTO prod (pId,a,b,c,d,e,f ,g,h,i)
      VALUES(SEQ_PROD.NEXTVAL,1,
      (select to_char(v.pdate,'YYYY')
      , to_char(v.pdate,'MM')
      , d.prod
      , ROUND(sum(v.f)/10)
      , COUNT(*)
      from ...
      group by to_char(v.pdate,'YYYY'), to_char(v.pdate,'MM'), d.prod
      )
      ,0,0,0);

      10 fields are mapped into 10 fields. Data types match. The sub-select statement works fine.

      Any ideas?

      Sedso