Inserting at specific row in android sqlite database

I am looking for a way to insert a new record at a specific row in a sqlite database in android. The basic idea is that the database stores records like this:

id   day        time
1   Monday     09:00
2   Monday     11:00
3   Tuesday    10:00


the id column is automatically incremented. The idea is that if you want to insert a new record "Monday 10:00", it must be inserted into the database at id 2, and the other records will be updated accordingly, ie. the entry "Monday 11:00" will become id 3, etc.

In short, is there a way to insert data into a specific row? If so, will it automatically change other entries?



source to share

2 answers

The short answer is no. Auto increment means you have no control over this field.



If you want to change a specific row in a table, you can use UPDATE .

INSERT INTO for adding new rows.



All Articles