Ticket #40434

KeyError: <class 'decimal.Decimal'> in execsql.py on line 3584 of execsql.
Eröffnet am: 2020-05-21 21:16 Letztes Update: 2020-05-30 18:27

Auswertung:
(Anonym)
Verantwortlicher:
(Keine)
Typ:
Status:
Geschlossen
Komponente:
(Keine)
Meilenstein:
(Keine)
Priorität:
5 - Mittel
Schweregrad:
5 - Mittel
Lösung:
Gefixt
Datei:
Keine

Details

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-Verlauf (3/5 Historien)

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

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 Aktualisiert von: rdnielsen
Kommentar

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

2020-05-22 12:44 Aktualisiert von: rdnielsen
  • Lösung Update from Keine to Gefixt
  • Status Update from Offen to Geschlossen
Kommentar

Fixed in 1.73.3.

2020-05-30 18:27 Aktualisiert von: None
Kommentar

Thank you very much!

Dateianhangliste

Keine Anhänge

Bearbeiten

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