-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
0

1 Answer 1

0

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

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.