The documentation says to put the database name on the front of the index name, not the table name when using the create index command. I thought it was weird myself.

Micha Bieber wrote:
I'm receiving sql errors like the following

"no such table: main.phs_matrices_1"

when trying to create an index using the syntax:

"CREATE INDEX IF NOT EXISTS phsm_1_idx ON phs_matrices_1 (a, b, c)"

from my C++ program.

The error statement is true - phs_matrices_1 doesn't belong to main,
but some attached database.
Trying to change the statement by full qualifying the attached table
( ... abc.phs_matrices_1 ...) causes a "syntax error near '.'".
The strange thing is, the table exists definitively yet and inserting
data etc. works at this moment (also with shortened table names, as it
has been stated in the documentation). So, the database should be
properly attached.

This is sqlite 3.3.5

Has anyone an idea, what went wrong here ?

Micha

Reply via email to