0

I have three columns in my database.

KEY_ID integer primary key autoincrement, KEY_MESSAGE string not null, KEY_POSITION integer not null

and i want to autoincrement both KEY_ID and KEY_POSITION. How can i do this?

harry perry
  • 123
  • 1
  • 8
  • 1
    See this http://stackoverflow.com/questions/7352508/sqlite-multiple-autoincrement-columns – Jamil Sep 05 '14 at 13:15
  • KEY_ID is already incrementing **spontaneously** (because it's defined as `autoincrement`). you can only increment KEY_POSITION. – Phantômaxx Sep 05 '14 at 13:17
  • Auto_increment field must be a key constraint. Either primary key or unique key. – ImMathan Sep 05 '14 at 13:18
  • From @DROIDDcoder suggestion i get that the value of autoincrement field cannot be altered, so is there any way i can copy the value of **KEY_ID** to **KEY_POSITION** on insertion of a record in database because i want to change the value of this field dynamically later on. – harry perry Sep 05 '14 at 16:52

0 Answers0