Replace the table name in query with variabale value
-
@dvlpr-bernard
I finally noticed the problem. It must betable_name = "\'1.0\'"
not
table_name = '1.0'
Thank you guys for your help :)
-
@dvlpr-bernard
One thing I meant to ask: what editor do you use when writing your Python code? If it's an IDE like PyCharm or VSCode it will helpfully show you when code is syntactically wrong, offer you methods/parameters to choose from etc.; if you are not using an editor with Python syntax you are missing out. -
@Denni-0 Thank you I will take note of that
-
@dvlpr-bernard
I imagine IDLE, being a Python editor, shows you errors, no? The point was, in your earlier erroneous code, I would have expected your editor to be showing you those lines were incorrect. -
@JonB HAHAHAHAHAH it works fine to me, IDLE also shows where the error is, but not as powerful as other IDE's can do. It would have been a little bit easier if I use other IDE's like PyCharm. But just like I what I have said I had so much fun and excitement using IDLE. Next time I would prob use PyCharm to put myself at ease.
-
@Denni-0 I'm sorry sir. I felt bad about the replies(they were indirectly telling me that I don't belong or I shouldn't be here), so I decided to delete it. Forget about it, I appreciate your help sir :).
-
@dvlpr-bernard said in Replace the table name in query with variabale value:
I felt bad about the replies(they were indirectly telling me that I don't belong or I shouldn't be here)
Hi @dvlpr-bernard, the Qt Forum is a place which welcomes everybody who wants to learn how to write software using Qt. If anyone says that you shouldn't be here, please let the Moderators know (click the triple-dots at the bottom-right of the post, and select "Flag this post for moderation") because we want to build a helpful and professional environment.
Anyway, I reviewed the replies in your other thread (Moderators can see deleted posts). I agree with @Denni-0 -- None of the replies were (directly or indirectly) saying that you don't belong here. Instead, they were saying that you should redesign your SQL database schema in order to solve your problem.
@Denni-0 said in Replace the table name in query with variabale value:
I would have contacted you directly but cannot figure out how to do that on this forum or even if its possible
You can send a Private Message from the user's profile page. Click the triple-dots and select "Start a new chat with <USERNAME>".