Cannot make index for non-main database

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Cannot make index for non-main database

Jiawei Duan
SQLite version: 3.24.0
System info: macOS 10.13.6

The following SQL commands results an error of "Error: near ".": syntax error”. However the command can proceed within the main database.

ATTACH DATABASE ‘/Users/***/test.db' AS dbondisk;
CREATE INDEX diskIndex on dbondisk.TestTable (Parent)


_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Cannot make index for non-main database

R Smith-2
The correct syntax is:

CREATE INDEX dbondisk.diskIndex on TestTable (Parent)


See: https://sqlite.org/lang_createindex.html


On 2018/08/27 5:37 PM, Jiawei Duan wrote:

> SQLite version: 3.24.0
> System info: macOS 10.13.6
>
> The following SQL commands results an error of "Error: near ".": syntax error”. However the command can proceed within the main database.
>
> ATTACH DATABASE ‘/Users/***/test.db' AS dbondisk;
> CREATE INDEX diskIndex on dbondisk.TestTable (Parent)
>
>
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users