Home > Net >  SQLite query doesnt't print in cmd
SQLite query doesnt't print in cmd

Time:10-15

I'm connected to a SQLite database named db.sqlite3 on Windows. After running .tables command I know which tables I have, so I'm trying to show one of them with select * from table1, without seeing any output in Windows Terminal.

Why is this happening? Should I use some special command to print the query output in terminal?

CodePudding user response:

I suspect your table has zero rows in it. Consider the following example in a blank database:

-- create a table
sqlite> create table "test"("field1" INTEGER);
-- select rows
sqlite> select * from test;
-- note: no output!
-- insert some values
sqlite> insert into test values(1),(2);
-- try the select again
sqlite> select * from test;
1
2
-- we have output!

-- to check if you have rows, do this:
sqlite> select count(*) from test;
2
-- 2 rows present
  • Related