On Tue, 22 Jul 2008, Keith Goodman wrote:

> On Tue, Jul 22, 2008 at 7:27 AM, Milton Centeno <[EMAIL PROTECTED]> wrote:
>> Thank you for your response.
>>
>> at the sqlite> prompt I enter sqlite3 test.db then I get ...>
>> entering .databases gives me another ...>
>> If I hit the Ctrl C it exits and closes the prompt window.
>
> The command 'sqlite3 test.db' launches the sqlite program. So don't
> enter it at the sqlite prompt. Enter it at your shell prompt.

Milton, try this. From the shell prompt, enter:

sqlite3 test.db

This will open or create a database named 'test.db' in the same folder. 
You will see the sqlite prompt 'sqlite>'. Then enter these lines:

CREATE TABLE table1 (field1, field2);
INSERT INTO table1 VALUES (1,"one");
INSERT INTO table1 VALUES (2,"two");
.quit

Be sure to enter the semi-colons, which are required to terminate each SQL 
statement.

After the '.quit', you are back to the shell prompt. If you look in that 
folder (e.g, 'dir *.db'), you will find a file called 'test.db'. This is 
the SQLite database you just created. If you re-start the program and pass 
this same filename, it will re-open that same database, and you can view 
the data you inserted by entering a SELECT statement:

cmdshellprompt>sqlite3 test.db
sqlite>SELECT * FROM table1;

To exit the SQLite command line program and return to your shell prompt, 
either enter '.quit' (with the leading period), or 'Ctrl-C'.

Chris



_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to