When i’m trying to delete a last row in a table using a PreparedStatement (I’m using a MySQL database), the row wasn’t been deleted, I tried to use a DELETE FROM… command and a TRUNCATE command (using the executeUpdate() command), but none of those commands deleted that last row, What should I do, in order to be able to delete that last row?
this is the command i have written:
String sqlDelete = "DELETE FROM free_time WHERE therapist_id=? AND from=? AND to=? AND date=?";
And I have checked that the parameters that i’m sending to the Prepared Statement are correct, but still, the row isn’t been deleted.
Thanks in advanced.
Last row doesn’t mean anything in a relational database. You don’t need to know how the rows are stored.
You should be using a WHERE clause to identify what you need to DELETE.
I wouldn’t recommend TRUNCATE.