Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 E-mail Us
 Oracle Articles

 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog

 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Oracle Support

 SQL Tuning

 Oracle UNIX
 Oracle Linux
 Remote s
 Remote plans
 Application Server

 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S


 Consulting Staff
 Consulting Prices
 Help Wanted!


 Oracle Posters
 Oracle Books

 Oracle Scripts

Don Burleson Blog 








ORA-00947: not enough values tips

Oracle Error Tips by Burleson Consulting


Oracle docs note this about ORA-00947:

  • ORA-00947 not enough values

    Cause: This error occurs when a SQL statement requires two sets of values equal in number, but the second set contains fewer items than the first set. This can occur in a WHERE or HAVING clause in which a nested SELECT returns too few columns as in:


    Another common cause of this error is an INSERT statement in which the VALUES or SELECT clause does not contain enough values needed for the INSERT, as in


    Action: Check the number of items in each set and change the SQL statement to make them equal.

  • On Oracle DBA-Forums, has a great example of ORA-00947, and a resolution. 
  • Question:
  • How do I resolve ORA-00947 in this situation?
  • SQL> run 1
    1 merge into aim m1
    2 using flataim m2 on ( = m1.snam)
    3 when matched then update set m1.snam =,
    4 m1.fnam = m2.fn, m1.lnam = m2.ln, m1.midnam =,
    5 m1.maidn =, m1.cntry =, =,
    6 =, m1.empt =, m1.nick = m2.nk,
    7 = m2.zp, m1.street = m2.rd
    8 when not matched then insert ((select aimsq.nextval from dual),
    9 m1.fnam, m1.lnam, m1.midnam,
    10 m1.maidn, m1.cntry, m1.state,, m1.nick,
    11, m1.street, m1.snam, m1.empt)
    12 values ( m1.fn, m2.ln,,,,,
    13* m2.nk, m2.zp, m2.rd,,;
    when not matched then insert ((select aimsq.nextval from dual),
    ERROR at line 8:
    ORA-00947: not enough values


    Because the ORA-00947 error signifies that there are not enough values passing through INSERT, the insert in the aim table should match all columns.  Here is an example, using snam:

    when not matched then insert
    m1.fnam, m1.lnam, m1.midnam,
    m1.maidn, m1.cntry, m1.state,, m1.nick,, m1.street, m1.snam, m1.empt)
    m1.fn, m2.ln,,,,,,
    m2.nk, m2.zp, m2.rd,,;


    Also, keep in mind while troubleshooting for ORA-00947, that the (select aimsq.nextval from dual) needs to be on the VALUES side.

    MOSC also offers information on ORA-00947 when it occurs along with attempting to add an insert statement, with all necessary columns properly stated. Here is an example:

    SQL> create table mytab (c1 date, c2 number);

    Table created.

    SQL> insert into mytab values(to_date('01-MAY-95',1));
    insert into mytab values(to_date('01-MAY-95',1))
    ERROR at line 1:
    ORA-00947: not enough values

    In this ORA-00947 case, you need to keep in mind that your parenthesis need to be meticulously placed and counted in order for ORA-00947 to be resolved.  




    oracle dba poster

    Oracle performance tuning software 
    Oracle Linux poster


    Burleson is the American Team

    Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

    Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

    Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  and include the URL for the page.


    Burleson Consulting

    The Oracle of Database Support

    Oracle Performance Tuning

    Remote DBA Services


    Copyright ? 1996 -  2014

    All rights reserved by Burleson

    Oracle ? is the registered trademark of Oracle Corporation.

    Hit Counter