File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes error of missing values Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "error of missing values" Watch "error of missing values" New topic

error of missing values

Megha Singhal
Ranch Hand

Joined: Feb 28, 2012
Posts: 225


when i'm trying the above code the following error is coming
"ORA-00947: not enough values"
sarada bokka
Ranch Hand

Joined: Jan 13, 2010
Posts: 80
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

Joined: Dec 19, 2011
Posts: 68

This is probabaly the error of unequal set column and values you are inserting, in your SQL Query. just try this.

Correct Me if i am wrong
Swastik Dey

Joined: Jan 08, 2009
Posts: 1584

Use PreparedStatement.

Rob Spoor

Joined: Oct 27, 2005
Posts: 20273

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.

How To Ask Questions How To Answer Questions
I agree. Here's the link:
subject: error of missing values
It's not a secret anymore!