Win a copy of Spark in Action this week in the Open Source Projects forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

NX:URLyBird About "deleted" flag

 
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My assignment said in my data section of database file have 1 byte "deleted" flag. 0 implies valid record. 1 implies deleted record. Whether this means the record isn't deleted , in fact , when the user delete it , only set it's "deleted" flag 1, but this record exist yet!
 
ranger
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, the record in reality still exists in the db.db file, however the space should be reclaimed by any new record. And no you do not need to implement a GUI to add records, just the method in the Data class.
So marking it deleted is all it has to do. It is similar to some databases, like for example in Foxpro you can mark records for deletion and they remain in the database. When you get the database exclusive and send a "Pack" command, then it actually deletes the data from the file.
Mark
 
Leo Tien
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Mark:

And no you do not need to implement a GUI to add records, just the method in the Data class.


Whether you mean the records' quantity on the data file is absolute, cann't increase or reduce it?
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The GUI does not need to be able to add or delete records. However the Data class is required to have methods that could add or delete records - the GUI just never calls them.
 
My previous laptop never exploded like that. Read this tiny ad while I sweep up the shards.
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic