Sqlite. How to create an index in attached DB?
- by kappa
I have a problem with adding index to memory database attached to main database.
1) I open the database (F) from file
2) Attach the :memory: (M) database
3) Create tables in database M
4) Copy data from F to M
I would also like to create an index in database M, but don't know how to do that.
This code creates index but in F database:
sQuery = "CREATE INDEX IF NOT EXISTS [INDID] ON [PANEL]([ID] ASC);";
I tried to add the name qualifier before table name like this:
sQuery = "CREATE INDEX IF NOT EXISTS [INDID] ON [M.PANEL]([ID] ASC);";
but SQLite returns with message that column main.M.PANEL does not exist.
What can I do?