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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
AartiRank #2,383 · 594 reputationPosted Nov 21, 2011, 2:53 AM EST
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.
VulpesRank #55 · 29.2K reputationPosted Nov 17, 2011, 12:21 AM EST
AartiRank #2,383 · 594 reputationPosted Nov 17, 2011, 2:53 AM EST
The .dump command shows us the SQL necessary to recreate the table.
Monika AroraRank #3,013 · 478 reputationPosted Nov 20, 2011, 11:35 PM EST
Monika AroraRank #3,013 · 478 reputationPosted Nov 20, 2011, 11:43 PM EST
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
COMMIT;
AartiRank #2,383 · 594 reputationPosted Nov 21, 2011, 3:01 AM EST
Refer below link to learn more about SQLite
http://www.pantz.org/software/sqlite/sqlite_commands_and_general_usage.html
VulpesRank #55 · 29.2K reputationPosted Nov 21, 2011, 6:04 AM EST
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.