Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

SQL error:java.sql.SQLException: ORA-01008: not all variables bound

 
Reggie McDougal
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm getting ORA-01008 when I run the following INSERT
statement, product_id is a PK and a number column, as I am using
"setString" should this be a long when I INSERT?

I'm using Oracle 8.1

REG




[edited to remove whitespace from beginning of lines so page doesn't scroll right]
[ January 27, 2005: Message edited by: Jeanne Boyarsky ]
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 35977
422
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Reggie,
It's better to use a long because it clearly expresses the intent of the setter and eliminates the possiblity of a database exception caused by an poorly formatted a string.
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You had 6 twice and didn't set something for 7.
cheers.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!