I know this is a very basic question but for some reason I can\'t get past this one error. I\'m trying to show/put all the names of the tables in a database (named \'GData.d
The query to list tables in a Sqlite database:
SELECT name FROM sqlite_master
WHERE type='table'
ORDER BY name;
So your snippet becomes:
con = sql.connect(r'/Users/linnk/Desktop/Results/GData.db')
mycur = con.cursor()
mycur.execute("SELECT name FROM sqlite_master WHERE type='table' ORDER BY name;")
available_table=(mycur.fetchall())
See the Sqlite FAQ for more info.