Issue
I am trying to get table structure using python from sqlite3 (.db) database. for that I am using the below code, but it is giving syntax error any help?
import sqlite3
conn = sqlite3.connect('Db-IMDB.db')
cursor = conn.cursor()
cursor.execute('DESCRIBE Movie')
Solution
It's not MySQL, but sqlite3. In Python API you can retrieve information on table from this statement:
table_info = cursor.execute("SELECT name FROM sqlite_master WHERE type='table';").fetchall()
Answered By - artona
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.