in MYSQL:
We can send Query to get tables from selected db, eg:
Code:
show tables from db_name
Or we can get all tables from all db:
Query will return 1 column, in C++ (omitting details) it's something like:
Code:
MYSQL_ROW row;
Memc<Str> *tables = new Memc<Str>;
while(row = mysql_fetch_row(result))
{
tables->add(row);
}
in MSSQL:
I never used it, but this query is probably correct:
Code:
select name from sys.tables;
Then fetch rows the same way as in mysql.
And finally in SQLITE, query:
Code:
SELECT name FROM sqlite_master WHERE type = 'table';
For MySQL and SQLite i've tested it.
In ODBC (never used) after connecting and executing query it could be something like:
Code:
Memc<Str> *tables = new Memc<Str>;
char name[MAX_TABLE_SIZE];
while(SQLFetch(sqlstatementhandle)==SQL_SUCCESS)
{
SQLGetData(sqlstatementhandle, 1, SQL_C_CHAR, name, MAX_TABLE_SIZE, NULL);
tables->add(name);
}