0
votes

I am new to SQLite3.

I am trying to create a DB in the shell. When I run the shell, it already shows:

SQLite version 3..

Enter ".help" for instructions ..

Enter SQL...

Enter SQL statements terminated with a ";"

I read somewhere that I should be able to type "$" and codes like "$ sqlite3 mynotes.db"

Now, I need to be able to name my DB (like "mynotes.db") and be able to decide in which folder I want it to be saved.

Can someone help me? Cheers!

1

1 Answers

2
votes

The $ somewhere was supposed to be a prompt of some shell (command processor), where you start sqlite3 and specify database name (which is created if does not exists).

If you're running sqlite3 without a shell (by clicking on sqlite3.exe?), it's time to try another way. CMD.EXE on Windows is as good for this job as a typical Unix shell.

As of the folder where the database will be: either cd to this folder before you run sqlite3 mynotes.db, or specify full pathname to the database: sqlite3 "C:\Users\Me\Documents and Settings\mynotes.db" (double quotes are needed when argument contains spaces).

When sqlite3 is started with no parameters, the database will be in memory. Sqlite3 supports "attaching" other databases (see ATTACH DATABASE description). This way, you can create and open on-disks databases even if starting sqlite3 with parameters is impossible for some reason (or too hard).