0

How to get the next autoincrement value of the field named Id in Receipt table in sqlite?

in sqlce i do the following and it works

SELECT AUTOINC_NEXT FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'Receipt' AND COLUMN_NAME = 'Id'

what is the parallel way in sqlite?

  • I suggest you read http://www.sqlite.org/autoinc.html – mthierer May 30 '14 at 13:59
  • i've read that but that doesn't give me the answer – user3547145 May 30 '14 at 14:02
  • It does. And as your question was just falsely flagged as duplicate (it might be a duplicate but not of the linked question), I'll explain it for you (untested, just using the information found there): It depends if the fields was declared AUTOINCREMENT or not. If not, it would be "SELECT MAX(ROWID) + 1 FROM Receipt", if it was, the solution should be "SELECT seq + 1 FROM sqlite_sequence WHERE name = 'Receipt'". – mthierer May 30 '14 at 14:24

0 Answers0