The following code lists the table names in a sqlite3 database.
sqlite3_stmt *stmt;
if (!sqlite3_prepare_v2(db,
"select name from sqlite_master where type='table' order by name",
-1, &stmt, NULL))
{
while (sqlite3_step(stmt) == SQLITE_ROW)
{
const char *name = (const char *)sqlite3_column_text(stmt, 0);
/* do stuff */
}
sqlite3_finalize(stmt);
}





