Role of .dump ?TABLE? in SQLite
Why we use .dump ?TABLE? in SQLite
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
AartiPosted Nov 21, 2011, 7:53 AM
Hi Monika,
do this step by step
step 1: need to create table named Cars
CREATE TABLE cars
(carid INTEGER NOT NULL,
color CHAR(25),
model VARCHAR(25),
PRIMARY KEY (carid),
UNIQUE (color)) ;
step 2: if you want to store your table in file use below
sqlite> .output cars.sql
step 3: to get backup of file
sqlite> .dump Cars
step 4: to quit
sqlite> .quit
Thanks.
please mark it as answer.
VulpesPosted Nov 21, 2011, 11:04 AM
The output you were getting from the command: .dump ?emp? is the sort of output you'd expect if you hadn't added any records to the table.
Assuming you have added some records, I'd try again with .dump emp
In other words, forget the question marks.
AartiPosted Nov 21, 2011, 8:01 AM
Refer below link to learn more about SQLite
http://www.pantz.org/software/sqlite/sqlite_commands_and_general_usage.html
Monika AroraPosted Nov 21, 2011, 4:43 AM
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
COMMIT;
Monika AroraPosted Nov 21, 2011, 4:35 AM
AartiPosted Nov 17, 2011, 7:53 AM
The .dump command shows us the SQL necessary to recreate the table.
VulpesPosted Nov 17, 2011, 5:21 AM