SQLITE table is gone after CREATE?

Hi guys,

I’m new to SQLITE.
I created two tables COMPANY and DEPARTMENT.
After creating these tables.
and exiting SQLITE3 command console.
And opening SQLITE again and viewing the tables I created.
by using the command below.

.tables

the tables are gone?

Can someone please help me with this.

thanks in advance.

You need to specify a filename where sqlite3 should store the data, i.e.,

sqlite3 mydatabase.db

when you create the tables then, quit, and open it again using the same filename the tables will still be there.

I’m not sure what happens with the data when you open sqlite3 without a filename, and the man isn’t to clear on that either, but the output of lsof doesn’t show it has any database file open, so I’m guessing it is stored in memory as long the program is running, and will be wiped from memory when you close the connection.

I believe you need the filename because unlike other databases, the file is the database.
So you need to specify it to be able to “connect”

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.