So I recently had an error with the default oracle db.backend of django. I performed a raw query directly on my db and it throw me an "django.db.utils.DatabaseError: ORA-24450: Cannot pre-process OCI statement". I knew the query itself was valid, because it ran in the old flask application as well as in table plus.
I googled and did not really find anything useful on that topic, other than the generic error description.
I will put the answer for future readers here. Hopefully it is helpful.
So you have to remove the comments. It is so easy but I found it nowhere and it was a wild guess when I was out of good ideas.
So just change your cursor.execute("SELECT * FROM your_db /*do the select*/")
to cursor.execute("SELECT * FROM your_db")