Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Insert into specific row in android sqlite database

Tags:

android

sqlite

I'm looking for a way to insert a new entry into a specific row in an sqlite database in android. The basic idea is that the database stores entries like this:

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

the ID column is auto incremented. The idea is that if you wanted to insert a new entry of "Monday 10:00" it should be inserted into the database at id 2, and the other entries would update accordingly i.e. the entry "Monday 11:00" would become id 3 etc.

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

Thanks

like image 611
Chrisrs2292 Avatar asked Feb 14 '26 04:02

Chrisrs2292


1 Answers

Short answer, no. Auto increment means you don't control the field.

like image 122
MByD Avatar answered Feb 15 '26 18:02

MByD



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!