I'm trying to get column names from a specific table.
EDIT: I forgot to mention it initially, but the python script i.e. gets the table names without any issues (different query), but the one selecting column names runs into an error.
When I write this query (see below) inside of DBeaver's SQL editor I get the expected result. But when I run the query inside of my python script, I get an error that COLUMN_NAME doesn't exist.
SELECT column_name FROM information_schema.columns WHERE table_schema=<database-name> AND table_name=<table-name>;
(db name and table name are correctly written in the real query)
I also need to mention, that when I previously used MySQL Workbench, this query written in python has worked as expected. It was when I switched to DBeaver for database management that the issue arose.
Are there possibly some further steps I need to do inside of DBeaver in order to get the information_schema to work as expected?
mysql --version >> mysql Ver 15.1 Distrib 10.4.13-MariaDB, for Linux (x86_64) using EditLine wrapper
WHERE table_schema=<database-name> AND table_name=<table-name>;
If there are no quotes around those two names, and if there is punctuation or spacing in the names, any of several error can occur.
Don't simply stick the names in; quote them and escape certain characters. Or use some "bind" technique. Show us the actual Python code that builds the string and the built SQL string.