Python+SQLite: how do I search the whole table(all columns)?
I need an expert advice for searching SQLite databases:
This python script is intended to be used for multiple databases, so I don't know beforehand what tables db has or what columns each table contains. I need to be able to search somehow all columns of a given table without knowing their names.
So far I'm able to retrieve the table names and then iterate through them. I've tried to search each table as:
dbCursor.execute('SELECT * FROM '+givenTableVar+' WHERE * LIKE '%textString%')
that doesn't work, however, because I can't use widcard "*" for the name of the column after the WHERE clause. Pysqlite want's me to specifically tell it the column name that I'm searching, while I need to search all columns at once.
Are there any clever way to search the whole table ( or even the whole db) for a given string that I can use?