Answer the question
In order to leave comments, you need to log in
How can I change the name of a table in a database query?
I have every query to the database changes the name of the table
Because of its change, an error occurs with incorrect syntax
cursor.execute('''
CREATE TABLE IF NOT EXISTS %s (
id INT AUTO_INCREMENT,
PRIMARY KEY (id)
)
''', (tableName))
Answer the question
In order to leave comments, you need to log in
In this form, no way. Substitution works only in crud requests and only for value substitution.
The only option is to write a function that will clean up the data and substitute only the values returned from such a function through f-strings .
But even so, if you think that you really need it - think again, are there any other ways to solve it?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question