I already have read some answers on this. But all of them are giving me the same error.
Here are the solutions I read:
- Link 1
-
import sqlite3 as sql #connect to database connection = sql.connect("database.db") #make a cursor which will move in the database cursor = connection.cursor() #execute the different command def execute(cursor, command): return cursor.execute(command) #print the result def print_result(result): for var in result: print(var) # select columns' name from table command = """select distinct emplyee from emplyee.information_schema.columns""" result = execute(cursor, command) print_result(result)
The table name is emplyee.
Error is: Traceback (most recent call last):
File "database.py", line 47, in
result = execute(cursor, command)
File "database.py", line 11, in execute
return cursor.execute(command)
sqlite3.OperationalError: near ".": syntax error