The error you're encountering during the ADF Copy Data activity when moving data from Dataverse to an Oracle Database 19c seems to be related to the datatype conversion of the GUID
from Dataverse to Oracle.
1. Change the GUID Mapping to a String Representation:
- Since Oracle does not have a native
GUID
datatype, you should store the GUID as a string in Oracle. Ensure that the destination columnACCOUNT_GUID
in Oracle is defined asVARCHAR2
(orNVARCHAR2
if you need Unicode support) with sufficient length (typically 36 characters).- In your mapping, ensure that the GUID is treated as a string. This should already be done based on your configuration, but ensure the length of the destination column is correct.
2. Use a String Conversion in ADF:
- If ADF is attempting to cast the GUID to a different type, you may need to explicitly convert the GUID to a string format before inserting it into Oracle. You can do this by using a derived column transformation in ADF to ensure that the GUID is treated as a string.
- Create a derived column in your ADF pipeline before the data is loaded into Oracle:
{ "name": "derived_column", "type": "DerivedColumn", "column": { "ACCOUNT_GUID_STRING": { "type": "string", "expression": "toString(accountid)" } } }
- Then map this derived column to your Oracle destination column.
- Create a derived column in your ADF pipeline before the data is loaded into Oracle:
3. Check the Oracle ODBC Driver:
- Ensure that the ODBC driver used for connecting to Oracle is up to date and compatible with the datatype mappings you're using. Sometimes, issues like this can be caused by an outdated or incompatible driver.
4. Modify ColumnSize, Precision, and Scale:
- If you're manually configuring the mapping, make sure the
ColumnSize
,Precision
, andScale
values are appropriately set for the Oracle destination. In some cases, setting these parameters explicitly can resolve issues related to type conversion.
5. Error Handling with Data Type Mismatch:
- You may also consider implementing error handling in your ADF pipeline to capture and manage rows that fail due to type conversion issues. This can help you identify specific problematic data.
6. Verify Oracle Field Type:
- Double-check that the field in Oracle is defined correctly to receive a string representation of a GUID. If you originally defined it as
NVARCHAR2
but still face issues, try setting it asVARCHAR2
if Unicode is not a concern, and ensure that the length is sufficient.
Example of Final Mapping in ADF:
"mappings": [
{
"source": {
"name": "accountid",
"type": "Guid"
},
"sink": {
"name": "ACCOUNT_GUID",
"type": "String",
"length": 36
}
},
{
"source": {
"name": "accountnumber",
"type": "String"
},
"sink": {
"name": "ACCOUNT_NUM",
"type": "String"
}
}
]