This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
hi, i want to delete a record from the table "myTab" and using this query.but when i run the prog. it executes without eror but the deletion is not performed in the table.wt is the problem plz help. my query is: UPDATE myTab SET flag = true WHERE id = 4
Bear already asked why you would expect and UPDATE to delete/remove a record from a table. Am I missing something? After executing your statement the record will still be in the table. You still need a DELETE statement to remove it from the table. If you are new to SQL and/or relational databases in general, you will need a tutorial.
Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
Some people do use flags to mark a record as "deleted". I wrote at least one system that I can recall where we never deleted anything but simply used a flag to identify a record as no longer being available. We then gacve the users a special screen they could use to recover "deleted" records. The users thought we were magicians!
In that case... Laura, Why do you think that your posted example UPDATE statement isn't working? Are you receiving an error message? If so, what is it? Or does the proper record seem to not actually be updated?
Soft delete is good option for certain aplication - by flaging a Record as Deleted , though it remains in the DataBase. Check whether u are committing the record after update is fired. Check whether the Record exists in the Table, which u r trying to update.
can we get more info on your setup? if you're using Access or the JDBC-ODBC bridge I'd say it could be the common 'missing update' problem. Try executing an dummy select after your update to 'flush' the connection.
Joined: Nov 13, 2003
Thanx friends... problemis solved.... David was right i did as he directed and am successful in doing the job.it was a missing update problem which i did no knew before. Thanx again to all helpers....