• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

error of missing values

 
Ranch Hand
Posts: 225
IBM DB2 Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
AddUser.java



addUser.jsp

when i'm trying the above code the following error is coming
"ORA-00947: not enough values"
 
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is a DB issue.
It say's the no of columns doesn't match with what you are trying to add. PERSONS table might be containing more or less columns.
 
Ranch Hand
Posts: 68
IBM DB2 Eclipse IDE Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is probabaly the error of unequal set column and values you are inserting, in your SQL Query. just try this.
 
Bartender
Posts: 2265
20
Android Java ME Eclipse IDE Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use PreparedStatement.
 
Sheriff
Posts: 21997
107
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Neeraj is right in that you need to specify the columns for inserting. Right now your statement expects a value for each and every column, in the right order. You're missing at least one value (possibly the auto-generated primary key?). Swastik is right that you should use PreparedStatement to prevent SQL injection.

And Megha, I believe this is the second time you posted code with some lines with very much spaces at the end. These mess up our forum layout a bit; can you try to remove those spaces next time? I've done it this time for you.
 
    Bookmark Topic Watch Topic
  • New Topic