sqlite3.OperationalError: no such table: sqlite_schema

Viewed 1434

I am facing a weird issue. In TablePlus when I run the following command it returns table but same query does not work in Python.

SELECT 
    name
FROM 
    sqlite_schema
WHERE 
    type ='table' 
    AND 
    name NOT LIKE 'lookup%';

Python code is given below:

def get_connection():
    path = 'data.sqlite3'
    connection = sqlite3.connect(path)
    return connection

sql_select = "SELECT name FROM sqlite_schema WHERE type ='table' AND name NOT LIKE 'lookup%';"
cursor = connection.execute(sql_select)

Error:

cursor = connection.execute(sql_select)
sqlite3.OperationalError: no such table: sqlite_schema

I am using SQLite 3.36

1 Answers

Change sqlite_schema for sqlite_master in PHP CPANEL VERSION 92, SUCCESS

Related