I am having a great deal of trouble with this seemingly simple issue. I can’t seem to get .read to work. Here is the code that I have tried:
Any help would be greatly appreciated!
Advertisement
Answer
.open test.sql
This opens a Sqlite3 database (Creating a new one if the file doesn’t already exist) and attaches it as the main one in the sqlite3 shell session.
.read test.sql
This attempts to read a text file full of SQL statements and execute them one by one.
A sqlite database is not a text file full of SQL statements, hence the syntax errors when you try to treat it as one.