• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Prepared Statement Error: not all variables bound.

 
Shawn Walter
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I get an error: Error Inserting: ORA-01008: not all variables bound

from this code:

vcQuery = "Insert into CUSTOMER.RECEIVINGDOCUMENTS ("+
"SupplierID, " +
"CIN, " +
"RecDocID, "+
"InDate "+
") values ("+
"?,"+
"?,"+
"?,"+
"?"+
")";
pstmt = conn.prepareStatement(vcQuery);
pstmt.setString(1, ps_SupplierID );
pstmt.setString(2, userCin);
pstmt.setString(3, ps_RecDocID );
odate = new java.sql.Date(dfin.parse(ps_InDate).getTime());
pstmt.setDate(4, odate);
pstmt.execute();

I have 4 variables and am binding all 4. Any help appreciated.
 
Paul Clapham
Sheriff
Posts: 21001
31
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Perhaps this is one of those misleading error messages where column names which don't exist in the table being updated are treated by the database as "unbound variables".
 
Shawn Walter
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply.

I just checked the database, and the data is being inserted even though I am getting this error. I guess I can just trap the error and go on.

any thoughts.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic