简体   繁体   English

SSIS中DB2压缩十进制与SQL Server DT_NUMERIC之间的查找转换

[英]Lookup transformation between DB2 packed decimal and SQL Server DT_NUMERIC in SSIS

We use DB2 as our main production database, but we use SQL Server for many other things ie to do integration between other customers and vendors via EDI etc. 我们使用DB2作为主要生产数据库,但是我们将SQL Server用于许多其他事情,即通过EDI等在其他客户和供应商之间进行集成。
I have a table in SQL with SO numbers and I try to make a lookup in DB2 to get all the invoices for the SO's in my table, so here's what I did. 我在SQL中有一个带有SO号的表,我尝试在DB2中进行查询,以获取表中SO的所有发票,所以这就是我所做的。

  1. Created a connection to the DB2 using the Microsoft® OLEDB Provider for DB2 使用Microsoft®OLEDB Provider for DB2创建了到DB2的连接
  2. Created a data fllow with a source using a SQL Server connection. 使用SQL Server连接使用源创建了数据流
  3. Added a Data Conversion Transformation trying to convert the INT so value to a decimal with a precision of 12, but I couldn't change a precision in a DT_DECIMAL, so the only datatype that I have the option to change the precision is DT_NUMERIC. 添加了一个数据转换转换,尝试将INT so值转换为精度为12的十进制,但是我无法更改DT_DECIMAL的精度,因此,我可以更改精度的唯一数据类型是DT_NUMERIC。
  4. Added a lookup transformation to lookup the data withing DB2. 添加了一个查找转换,以使用DB2查找数据。

Now when i try to create the join between the source table and DB2 I get an error Cannot map the input column, 'so', to the lookup column, 'orno', because the data types do not match. 现在,当我尝试在源表和DB2之间创建Cannot map the input column, 'so', to the lookup column, 'orno', because the data types do not match.出现错误Cannot map the input column, 'so', to the lookup column, 'orno', because the data types do not match.
According to Microsoft this is not a bug and they suggest to use the DT_NUMERIC where you can change the precision. 根据Microsoft的说法,这不是错误,建议使用DT_NUMERIC来更改精度。
If I try to convert the SO to a DT_DECIMAL without changing the precision I'd get the same error mentioned above. 如果我尝试在不更改精度的情况下将SO转换为DT_DECIMAL,则会收到与上述相同的错误。

Is there any way to work around the limitations from SSIS and change the precision in a DT_DECIMAL conversion so I could do the match? 有什么方法可以解决SSIS的限制并更改DT_DECIMAL转换中的精度,以便我可以进行匹配吗?

Or any other suggestions? 或其他建议?

The simple answer is to change the connection property in the DB2 connection to treat DECIMAL as NUMERIC. 简单的答案是更改DB2连接中的连接属性,以将DECIMAL视为NUMERIC。
See bellow 见波纹管 在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM