Krishna
Krishna

Reputation: 3007

No such table SQLITE_SEQUENCE from AIR/Actionscript

I'm trying to reset the seed for an autoincrement field in SQLITE using AIR/ActionScript/Flex 4.5.

I'm doing what should normally work:

DELETE FROM SQLITE_SEQUENCE WHERE NAME = 'myTable'

I've checked that the database actually contains a SQLITE_SEQUENCE table. I'm able to execute the above statement without errors directly via the Firefox SQLITE plugin (SQLite Manager).

However, when I try to do the same using actionscript, I get an error:

No such table 'SQLITE_SEQUENCE'.

All I could find in searching around was this one guy who posted everywhere he could find - only to be left without an answer: here and here and here

Any ideas?

Upvotes: 7

Views: 7671

Answers (2)

Ahmad Hamdy Hamdeen
Ahmad Hamdy Hamdeen

Reputation: 556

You should to insert "Auto increment" to primary key column at least to one table, Then SQLite is creating "SQLITE_SEQUENCE" table.

To get all tables have Auto increment:

SELECT * FROM SQLITE_SEQUENCE;

Upvotes: 0

bioffe
bioffe

Reputation: 6393

sqlite_sequence table is not created, until you define at least one autoincrement and primary key column in your schema.

Upvotes: 18

Related Questions