• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

cant delete frrom table

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why would you expect an UPDATE op to perform a delete? Perhaps a DELETE op would be more effective?
bear
 
Laura Mike
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i know but i want to do it with update for some reason.
am i doing it in wrong way?
 
Ranch Hand
Posts: 1514
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
mister krabs
Posts: 13974
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Laura Mike
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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....
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic