Ticket #40434

KeyError: <class 'decimal.Decimal'> in execsql.py on line 3584 of execsql.
Date d'ouverture: 2020-05-21 21:16 Dernière mise à jour: 2020-05-30 18:27

Rapporteur:
(Anonyme)
Propriétaire:
(Aucun)
Type:
État:
Atteints
Composant:
(Aucun)
Jalon:
(Aucun)
Priorité:
5 - moyen
Sévérité:
5 - moyen
Résolution:
Fixed
Fichier:
Aucun

Détails

I'm trying to use the COPY QUERY metacommand to add the results from a query on the originating database (MariaDB) to the destination database (SQLServer). The query is correct, since I've been able to dump its content to stdout using execsql. However, turns out the destination database is using a field of type money (https://docs.microsoft.com/en-us/sql/t-sql/data-types/money-and-smallmoney-transact-sql?view=sql-server-ver15) which execsql seem to not understand, and so it fails when trying to map data to that type.

Ticket History (3/5 Histories)

2020-05-21 21:16 Updated by: None
  • New Ticket "KeyError: <class 'decimal.Decimal'> in execsql.py on line 3584 of execsql." created
2020-05-21 21:47 Updated by: None
Commentaire

I was able to fix this by adding self.dt_castDecimal = DT_Decimal().from_data to execsql.py after line 3490, with the code now looking as:

self.encoding = encoding or 'latin1' # Default on installation of SQL Server self.dt_castDecimal = DT_Decimal().from_data self.encode_commands = True self.paramstr = '?'

2020-05-22 00:20 Updated by: rdnielsen
Commentaire

Thanks. The general solution is to specify that cast in the Database class; I will make that change.

2020-05-22 12:44 Updated by: rdnielsen
  • Résolution Update from Aucun to Fixed
  • État Update from Ouvert to Atteints
Commentaire

Fixed in 1.73.3.

2020-05-30 18:27 Updated by: None
Commentaire

Thank you very much!

Attachment File List

No attachments

Modifier

You are not logged in. I you are not logged in, your comment will be treated as an anonymous post. » Connexion