-1
import sqlite3
connection = sqlite3.connect("vsearchlogDB.db")
print("Opened database successfully")  
cursor = connection.cursor()
_SQL = """.tables"""
cursor.execute(_SQL)
print(cursor.fetchall())

Output

>>>python3 dbconnect.py 
Opened database successfully
Traceback (most recent call last):
File "/home/amrit/Documents/webapp/dbconnect.py", line 6, in <module>
cursor.execute(_SQL)
sqlite3.OperationalError: near ".": syntax error
Ma0
  • 15,057
  • 4
  • 35
  • 65

1 Answers1

0

You need to remove the "." from _sql because you are executing a sql command which does not accept "."

looaka
  • 18
  • 6