Skip to content
Advertisement

Django sql statements with non english symbols

I have sql statement, with non english symbols in where

(sap_code variable contains russian text)

And I get such error django.db.utils.DatabaseError: ORA-00911: invalid character (oracle database)

Is there any way to fix that?

Advertisement

Answer

This is an Oracle limitation. You will need to quote your non-ASCII characters. I’ve changed your final fragment to double quotes and then quoted the internal string. That should resolve this issue if you’re dead-set on using raw SQL here.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement