Synchronizing Database with server
Is 开发者_StackOverflow社区there any method by which I can set expiry time for a database(table)?
I have data coming from server on first time login which i store in database. The next time I need to have a flag or something associated with database which tells me its updated or not. Sort of Timestamp but associated with complete table instead of a particular row.
Not sure I understand your question completely, but if you need to keep track of when a table was last updated you could simply use another table table_last_update
with two columns table_name
and last_update_time
or something like that.
But warning: you would have to update this reference table each time you insert/update the referenced tables. So this is more work (at runtime probably, and for the number of bugs this could introduce) than keeping a timestamp column in your table, and properly indexing it.
Edit: using a trigger on the referenced tables could be a nice way of implementing the updates to the timestamp table.
精彩评论