0

I am attempting to move my learn.db file to a new folder, however when I entered the necessary commands :

.output ./iivri.andre/lxdb/teenager.sql 

I received this error message

sqlite> .output ./iivri.andre/lxdb/teenager.sql
Error: cannot open "./iivri.andre/lxdb/teenager.sql"
Error: cannot write to "./iivri.andre/lxdb/teenager.sql"

How can I fix this ?

Cheers,

Andre

siur
  • 919
  • 2
  • 9
  • 11
  • Do note .sql is a script file of DDL and DML statements (which you `.read` at command line to run operations). To avoid conflict with other systems/apps, consider .db, .sqlite, .sqlite3 extensions. – Parfait Dec 25 '16 at 07:19
  • @Parfait Thank you. However I did name the database as learn.db, the table is teenager so that is why I named it with the `.sql`. Should I have attached the teenager to `.db`? – siur Dec 25 '16 at 07:23
  • I do not understand. A database contains tables, views, etc. You cannot save an individual table externally. You can export its contents to [text files](http://stackoverflow.com/questions/6076984/how-do-i-save-the-result-of-a-query-as-a-csv-file) (.csv, .txt, etc.) – Parfait Dec 25 '16 at 07:26
  • @Parfait Ok. After I actually created the `learn.db` file I am suppose to `.output` the database to a folder called `lxdb`. So the goal is to create a folder and allow that folder to hold the `learn.db` elsewhere. – siur Dec 25 '16 at 07:33
  • Try the backup command: `.backup "/full/path/to/lxdb/learner.db" ` – Parfait Dec 25 '16 at 08:09

0 Answers0