ORA-01008: not all variables bound
I am getting 'not all variables bound' error for the following code.
Can you please help me to find out why?
There are four bind variables in the qery and I'm setting values for all of them. Don't understand why I am still getting this error. I tried by using executeQuery() instead of executeUpdate(), still doesn't work.
Please see the code below.
Thanks in advance.
private void updateTable(String name, String circuit, boolean deletedFlag, boolean updatedFlag){
PreparedStatement statement = null;
ResultSet resultSet = null;
String flag = null;
String sql = " insert into temp_assertion_errors "
+ " values(?, ?, ?, ?) ";
int num = 0;
try{
statement = DBUtil.getConnection().prepareStatement(sql);
statement.setString(1, name);
statement.setString(2, circuit);
if(deletedFlag)
flag = "Yes";
else
flag = "No";
statement.setString(3, flag);
if(updatedFlag)
flag = "Yes";
else
flag = "No";
statement.setString(4, flag);
num = statement.executeUpdate(sql);
if(num != 1){
System.out.println("Name: " + name + ", Circuit : " + circuit + ", deleted : " + deletedFlag +
",updated : " + updatedFlag);
System.out.println("Error! ");
}
}catch(SQLException sqle){
System.out.println("Name: " + name + ", Circuit : " + circuit + ", deleted : " + deletedFlag +
", updated : " + updatedFlag);
System.out.println("SQLException in updateTable() : " + sqle.getMessage());
}
}

