I don't know SQLite Queries well, I don't know how to make fixed size rows in sqlite table. After full table rows value, I want to override first(Oldest) one and after that second and so on.. I made a table which I clear every day at 00AM but I think it is not a good coding practice. Please suggest me solution for how to do that.
Asked
Active
Viewed 162 times
0
-
So... simply update your fixed number of rows, instead of inserting new ones and deleting the old ones. – Phantômaxx Apr 21 '15 at 10:24
-
@DerGolem But what about _Id it is easy to delete it first but in future how i get what exactly i am going to delete. – Ambitious Person Apr 21 '15 at 10:27
-
1refer this link i hope it will help you http://stackoverflow.com/questions/2035670/limit-an-sqlite-tables-maximum-number-of-rows – Rakesh Kalashetti Apr 21 '15 at 10:33
-
Thanx @Rakesh i think, i got solution from these link. – Ambitious Person Apr 21 '15 at 10:40
-
1Also see that answer: http://stackoverflow.com/a/19033834/11654 – CL. Apr 21 '15 at 10:41
-
@CL. Thanx you also give me second option. But i am confuse in that, is it good way for _Id ? – Ambitious Person Apr 21 '15 at 10:52
-
When you have an autoincrementing `_id` column, the smalles values are the oldest ones. – CL. Apr 21 '15 at 10:54
1 Answers
1
I got my Answer from @CL (Best Solution) & @Rakesh Thank you so much
linkFromCL – From @CL.
linkFromRakesh – From @Rakesh

Community
- 1
- 1

Ambitious Person
- 295
- 1
- 3
- 15