Sqlite3 prompting `...>` instead of `sqlite>`

Sqlite is working normally. However, the sqlite movies.db command should be issued from your system command line – not from the Sqlite interactive shell. Start by exiting the Sqlite interactive shell (.exit), then issuing the database creation command.

According to the quickstart documentation:

  1. At a shell or DOS prompt, enter: "sqlite3 test.db". This will create a new database named "test.db". (You can use a different name if you like.)

  2. Enter SQL commands at the prompt to create and populate the new database.

Once the sqlite movies.db command is properly executed from your system command line, you'll automatically be placed in the Sqlite interactive shell, which will be awaiting commands.

sqlite> create table tbl1(one varchar(10), two smallint);

The ...> shell prompt indicates a continuance from the preceding line. As indicated in the message, you'll need to terminate each database command with a ; semicolon.

sqlite> CREATE TABLE tbl2 (
   ...>   f1 varchar(30) primary key,
   ...>   f2 text,
   ...>   f3 real
   ...> );
sqlite>

Terminate the statement with a ;. So just hit ; then enter and it will go back to normal (after giving an error, because what you've typed here is bad sql).

What's going on is it thinks you are still working on something. It can be useful to break up long queries into lines like this:

sqlite> select title, description
   ...> from mytable
   ...> where id > 10;

And the ...> means it is waiting for you to finish your query, which you signify with the semicolon.

Tags:

Sqlite