如何复制NUMBER(30,8) [英] How to copy NUMBER(30,8)

查看:149
本文介绍了如何复制NUMBER(30,8)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在ADF复制活动中,您可以指定应该匹配的列,对于每种数据库类型,它都使用数据类型的映射.

In the ADF copy activity you can specify which columns should be matched and for each database type it is using a mapping of data types.

现在我有一个问题,我想将数据从Oracle复制到Azure SQL,并且根据https://docs.microsoft.com/en-us/azure将一列定义为NUMBER(30,8) /data-factory/connector-oracle#data-type-mapping-for-oracle它在内部使用 为此,在ADF中使用STRING的数据类型(因为精度大于28).现在,我收到错误消息数据源中字符串类型的给定值无法转换为指定目标列的十进制类型."哪一个 这是可以理解的,因为在内部,我在ADF中有STRING,并且我的目标DB列指定为DECIMAL(30,8).

Now I have the problem that I want to copy data from Oracle to Azure SQL and one column is defined as NUMBER(30,8) and according to https://docs.microsoft.com/en-us/azure/data-factory/connector-oracle#data-type-mapping-for-oracle it is using internally in ADF a data type of STRING for this (because the precision is bigger than 28). And now I am getting the error message "The given value of type String from the data source cannot be converted to type decimal of the specified target column." which is understandable because internally I have STRING in ADF and my target DB column is specified as DECIMAL(30,8).

那我该怎么办才能解决这个问题?我可以告诉ADF将STRING转换为DECIMAL(30,8)吗?

So what can I do to get around this problem? Is there something that I can tell ADF to transform the STRING to a DECIMAL(30,8)?

干杯

Thomas

推荐答案

您可以使用存储过程将数据类型(从String转换为Decimal),然后再将其存储到Azure SQL.要了解有关调用存储过程的更多信息,请查看以下文档:

You can use a stored procedure to convert the data type(from String to Decimal) before storing it to Azure SQL. To read more about invoking stored procedures, have a look at this doc :

https://docs.microsoft.com/zh-cn/azure/data-factory/connector-sql-server#invoking-stored-procedure-for-sql-sink

https://docs.microsoft.com/en-us/azure/data-factory/connector-sql-server#invoking-stored-procedure-for-sql-sink

此外,我发现了一个类似的问题,可能也对您有帮助:

Also, I found a similar issue that might be of help in your case as well :

https://stackoverflow.com/questions/51412683/azure-data-factory-copy-activity-failed-mapping-strings-from-csv-to-azure-sql

https://stackoverflow.com/questions/51412683/azure-data-factory-copy-activity-failed-mapping-strings-from-csv-to-azure-sql

让我们知道这是否有帮助.否则,我们很乐意继续进行进一步的研究.

Let us know if this helps. Else we can gladly continue to probe in further.


这篇关于如何复制NUMBER(30,8)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆