SQLite Forum

3 incorrect tables created during import
Login
Probably easiest by showing you what's happening.  First, if a temp table exists and a non-temp table with the same name doesn't exist, SQLite uses the temp one:

<code>sqlite> create table temp.test1 (a);
sqlite> insert into temp.test1 values (123);
sqlite> select * from temp.test1;
123
sqlite> select * from test1;
123
sqlite> </code>

Then we see that FTS5 creates a number of tables, not just the one you name:

<code>sqlite> create virtual table temp.filesinfts5 using fts5(filename);
sqlite> .tables
temp.filesinfts5          temp.filesinfts5_content  temp.filesinfts5_docsize
temp.filesinfts5_config   temp.filesinfts5_data     temp.filesinfts5_idx
sqlite> </code>

Then I test importing the file list:

<code>sqlite> .import files filesinfts5
sqlite> select * from filesinfts5;
CPMap.png
fhyogs1jjj661.png
files
myCPMap.png
wording.txt
sqlite> </code>

You may have had .headers turned on:

<code>sqlite> .headers on
sqlite> select * from filesinfts5;
filename
CPMap.png
fhyogs1jjj661.png
files
myCPMap.png
wording.txt
sqlite> </code>

Hope that helps.