Click here to Skip to main content
15,352,563 members
Home / Discussions / Database
   

Database

 
GeneralRe: List all tables from a specific database Pin
_Flaviu12-Jan-22 5:19
Member_Flaviu12-Jan-22 5:19 
GeneralRe: List all tables from a specific database Pin
Richard MacCutchan12-Jan-22 5:41
mveRichard MacCutchan12-Jan-22 5:41 
GeneralRe: List all tables from a specific database Pin
_Flaviu12-Jan-22 6:16
Member_Flaviu12-Jan-22 6:16 
GeneralRe: List all tables from a specific database Pin
Richard MacCutchan12-Jan-22 6:43
mveRichard MacCutchan12-Jan-22 6:43 
QuestionWampServer localhost Pin
_Flaviu6-Jan-22 6:59
Member_Flaviu6-Jan-22 6:59 
AnswerRe: WampServer localhost Pin
Graham Breach6-Jan-22 21:10
MemberGraham Breach6-Jan-22 21:10 
GeneralRe: WampServer localhost Pin
_Flaviu6-Jan-22 23:53
Member_Flaviu6-Jan-22 23:53 
QuestionSQLite sqlite_schema missing Pin
_Flaviu4-Jan-22 4:20
Member_Flaviu4-Jan-22 4:20 
How can I get the number of the tables from a sqlite3 database ?

I downloaded from here: SQLite Sample Database And Its Diagram (in PDF format)[^]
chinook.db
But when I try to get all tables from this database:
SQL
SELECT * FROM sqlite_schema WHERE type = 'table' AND name NOT LIKE 'sqlite_%'

I got:
SQL
no such table: sqlite_schema

I also tried to create a database on my own:
C++
SQLite::Database db("C:\\Temp\\mydb.bd3", SQLite::OPEN_READWRITE | SQLite::OPEN_CREATE);
		db.exec(_T("CREATE TABLE sqlite_schema(type TEXT, name TEXT, tbl_name TEXT, rootpage INTEGER, sql TEXT)"));
		db.exec(_T("PRAGMA foreign_keys = ON"));

and
C++
db.exec(_T("DROP TABLE IF EXISTS master"));
		db.exec(_T("CREATE TABLE master(masterid INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, name TEXT)"));
		db.exec(_T("DROP TABLE IF EXISTS app"));
		db.exec(_T("CREATE TABLE app (appid INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, name TEXT)"));
		db.exec(_T("DROP TABLE IF EXISTS device"));
		db.exec(_T("CREATE TABLE device (deviceid INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, masterid INTEGER, appid INTEGER, name TEXT, FOREIGN KEY(masterid) REFERENCES master(masterid), FOREIGN KEY(appid) REFERENCES app(appid))"));

but when I try the same SQL:
SQL
SELECT * FROM sqlite_schema WHERE type = 'table' AND name NOT LIKE 'sqlite_%'

I got the same error:
SQL
no such table: sqlite_schema

How can I assure to retrieve all tables from a db3 (db) file ?
AnswerRe: SQLite sqlite_schema missing Pin
Richard Deeming4-Jan-22 4:40
mveRichard Deeming4-Jan-22 4:40 
GeneralRe: SQLite sqlite_schema missing Pin
_Flaviu4-Jan-22 7:16
Member_Flaviu4-Jan-22 7:16 
GeneralRe: SQLite sqlite_schema missing Pin
_Flaviu4-Jan-22 7:17
Member_Flaviu4-Jan-22 7:17 
QuestionDate and Time Add Incompatibility between sql 2012 and sql 2018 Pin
Medo-I23-Dec-21 7:42
MemberMedo-I23-Dec-21 7:42 
AnswerRe: Date and Time Add Incompatibility between sql 2012 and sql 2018 Pin
Richard Andrew x6423-Dec-21 8:56
professionalRichard Andrew x6423-Dec-21 8:56 
QuestionRe: Date and Time Add Incompatibility between sql 2012 and sql 2018 Pin
CHill6029-Dec-21 5:31
mveCHill6029-Dec-21 5:31 
AnswerRe: Date and Time Add Incompatibility between sql 2012 and sql 2018 Pin
jschell29-Dec-21 7:34
Memberjschell29-Dec-21 7:34 
AnswerRe: Date and Time Add Incompatibility between sql 2012 and sql 2018 Pin
Richard Deeming4-Jan-22 0:44
mveRichard Deeming4-Jan-22 0:44 
QuestionRoelf Pin
floris rudolf vieira22-Dec-21 6:58
Memberfloris rudolf vieira22-Dec-21 6:58 
AnswerRe: Roelf Pin
jschell23-Dec-21 6:12
Memberjschell23-Dec-21 6:12 
AnswerRe: Roelf Pin
0x01AA5-Jan-22 4:44
professional0x01AA5-Jan-22 4:44 
QuestionSQL SERVER Pin
ali khan Dec202118-Dec-21 22:36
Memberali khan Dec202118-Dec-21 22:36 
AnswerRe: SQL SERVER Pin
Richard MacCutchan19-Dec-21 6:57
mveRichard MacCutchan19-Dec-21 6:57 
AnswerRe: SQL SERVER Pin
0x01AA5-Jan-22 4:46
professional0x01AA5-Jan-22 4:46 
Question2 queries from Oracle Pin
_Flaviu15-Dec-21 1:41
Member_Flaviu15-Dec-21 1:41 
AnswerRe: 2 queries from Oracle Pin
scottgp15-Dec-21 2:01
professionalscottgp15-Dec-21 2:01 
GeneralRe: 2 queries from Oracle Pin
_Flaviu15-Dec-21 2:41
Member_Flaviu15-Dec-21 2:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.