Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

error of missing values

 
Megha Singhal
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"
 
sarada bokka
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.
 
Neeraj Dhiman
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.
 
Swastik Dey
Rancher
Posts: 1604
5
Android Java Java ME
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use PreparedStatement.
 
Rob Spoor
Sheriff
Pie
Posts: 20550
57
Chrome Eclipse IDE Java 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic