| Author |
Prepared Statement Error: not all variables bound.
|
Shawn Walter
Greenhorn
Joined: Jan 14, 2010
Posts: 2
|
|
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
Bartender
Joined: Oct 14, 2005
Posts: 16483
|
|
|
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
Joined: Jan 14, 2010
Posts: 2
|
|
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.
|
 |
 |
|
|
subject: Prepared Statement Error: not all variables bound.
|
|
|