SQLite - a smart way to remove and add new objects

Posted by Ilya on Stack Overflow See other posts from Stack Overflow or by Ilya
Published on 2009-03-20T15:27:01Z Indexed on 2010/04/01 22:33 UTC
Read the original article Hit count: 435

Filed under:
|
|

Hi, I have a table in my database and I want for each row in my table to have an unique id and to have the rows named sequently.

For example: I have 10 rows, each has an id - starting from 0, ending at 9. When I remove a row from a table, lets say - row number 5, there occurs a "hole". And afterwards I add more data, but the "hole" is still there.

It is important for me to know exact number of rows and to have at every row data in order to access my table arbitrarily.

There is a way in sqlite to do it? Or do I have to manually manage removing and adding of data?

Thank you in advance, Ilya.

© Stack Overflow or respective owner

Related posts about sqlite

Related posts about iphone