0

I'm importing a csv to a table in the database in the following way. In terminal:

Terminal>sqlite3 test.db 
sqlite3>.import /Users/Downloads/test.csv trial1
sqlite3> attach database 'test.db' as 'alias_test';
sqlite3> .database
seq name file 
--- --------------- ----------------------------------------------------------
0 main /Users/Downloads/testattach.db 
2 test_alias /Users/Downloads/testattach.db 

But when I restart the terminal and type:

>sqlite3 test.db '.database'

I get:

seq name file 
--- --------------- ----------------------------------------------------------
0 main /Users/Downloads/testattach.db 

I want to understand why the attached database name is not shown when I access the database again.

asked Jul 7, 2016 at 18:45

1 Answer 1

2

The documentation says:

The ATTACH DATABASE statement adds another database file to the current database connection.

Restarting creates a new connection.

answered Jul 8, 2016 at 7:32
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.