Skip to content Skip to sidebar Skip to footer

Error: Sqlite3.operationalerror: No Such Table: Main.m

I have a very simple code in python, basically I try to create indexes for each table in my database (already exists). The database and my script file are located at the same folde

Solution 1:

If the tableName variable shows the correct table names as per your comment, then just use tableName when you create the sql statement instead of tableName[m]:

c.execute("CREATE INDEX IF NOT EXISTS "+tableName+"Date ON "+tableName+" (date)");
c.execute("CREATE INDEX IF NOT EXISTS "+tableName+"Year ON "+tableName+" (year)");  

Post a Comment for "Error: Sqlite3.operationalerror: No Such Table: Main.m"