Interested in improving this site? Please check the To Do page.

Back to SQLite Verbs

sqlite.getTableNames

Retrieve a list of table names in an SQLite database.

Syntax

sqlite.getTableNames (dbID, type="table")

Params

dbID is the database ID returned by sqlite.open. type is an optional parameter used to specify the type of table names returned. Valid options for type are “table”, “index”, “view”, and “trigger”.

Returns

A Frontier list containing a list of the tables, indices, views, or triggers defined in the database file.

Examples

on showTables () {
	local (db, output);
	db = sqlite.open("C:\\temp\\world.db3");
	output = sqlite.getTableNames (db);
	dialog.alert(output);
	sqlite.close(db)}
on showIndices () {
	local (db, output);
	db = sqlite.open("C:\\temp\\world.db3");
	output = sqlite.getTableNames(db, "index");
	dialog.alert(output);
	sqlite.close(db)}

Notes

sqlite.getTableNames takes advantage of the table sqlite_master defined in all SQLite tables. sqlite_master contains all sorts of interesting information that may be useful to understanding the database definition.

See Also


Personal Tools