I am new to database. I am trying to create a database and table in it. but unable to save and open again after exiting from sqlite. I am using sqlite3 3.6.20 on centOS, when i will enter following command
.save ex1.db or .open ex1.db
it will print following error message.
Error: unknown command or invalid arguments: "save". Enter ".help" for help Error: unknown command or invalid arguments: "open". Enter ".help" for help
and when Print .help it wont show any command related to save and open existing database. thanks in advance.
Open the database or database object. On the File tab, click Save As. Do one of the following steps: To save a database in a different format, click Save Database As.
Right-click on the database, and select "Export the database".
The Android SDK provides dedicated APIs that allow developers to use SQLite databases in their applications. The SQLite files are generally stored on the internal storage under /data/data/<packageName>/databases.
I am trying to create a database and table in it. but unable to save and open again after exiting from sqlite.
You don't need to save. Each transaction writes to disk. (More or less.)
To create the database "test.sl3", you can do this. (From the command line. Programs work about the same way.)
$ sqlite3 test.sl3 SQLite version 3.8.7.2 2014-11-18 20:57:56 Enter ".help" for usage hints. sqlite> create table test (test_id integer primary key); sqlite> insert into test values (1); sqlite> select * from test; 1 .quit
No .save
. Now load the database again.
$ sqlite3 test.sl3 SQLite version 3.8.7.2 2014-11-18 20:57:56 Enter ".help" for usage hints. sqlite> select * from test; 1
The data is still there.
You're supposed to provide a filename as an argument for the .save command, e.g.:
sqlite> .save ex1.db
docs: http://www.sqlite.org/cli.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With