待辦事項 #40434

KeyError: <class 'decimal.Decimal'> in execsql.py on line 3584 of execsql.
啟用日期: 2020-05-21 21:16 最後更新: 2020-05-30 18:27

回報者:
(匿名)
負責人:
(無)
類型:
狀態:
關閉
元件:
(無)
里程碑:
(無)
優先權:
5 - 中
嚴重程度:
5 - 中
處理結果:
修正
檔案:

細節

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
評語

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
評語

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
  • 處理結果 Update from to 修正
  • 狀態 Update from 開啟 to 關閉
評語

Fixed in 1.73.3.

2020-05-30 18:27 Updated by: None
評語

Thank you very much!

Attachment File List

No attachments

編輯

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