I have an error in an sql query that I make to the firebird / interbase database with python. This one throws me an error:
for rec in cur.fetchall():
kinterbasdb.ProgrammingError: (-802, 'fetch: \n arithmetic exception, numeric o
verflow, or string truncation\n Cannot transliterate character between characte
r sets')
I understand that it is a problem of characters, because the error is when extracting the data SELECT ciudad.descripcion FROM clientes
, this contains for example Cordoba V. Allende
. I think the error is in the .
of the data, since when extracting the query from python cursor.execute(QUERY)
, two types of data are being executed, one text string and the other special character.
I have used several functions, but I have not had satisfactory results, for example:
CAST(ciudad.descripcion AS varchar(40))
or
CAST(ciudad.descripcion AS varchar(40) character set UTF-8)
I get this error:
cur.execute(SELECT)
kinterbasdb.ProgrammingError: (-104, 'isc_dsql_prepare: \n Dynamic SQL Error\n
SQL error code = -104\n Token unknown - line 1, column 80\n -')
Greetings and thanks in advance!