Microsoft Fabric Error:
ArgumentOutOfRangeException
What does this error mean?
A copy pipeline reading from Oracle via Fabric Data Factory failed because an Oracle DateTime value is outside the range supported by Azure Data Factory and Synapse (0001-01-01 to 9999-12-31). Oracle supports BC-era dates and second values above 59 which have no equivalent in .NET DateTime.
Common causes
- 1Oracle table contains BC-era dates (year < 1) which cannot be represented in .NET DateTime
- 2Oracle stores second or minute values greater than 59 (valid in Oracle, invalid in .NET)
- 3Source table has historical data loaded from legacy systems with non-standard date representations
- 4DateTime columns were not validated when data was loaded into Oracle
How to fix it
- 1Run `SELECT dump(<column_name>) FROM <table> WHERE <column_name> < DATE '0001-01-01' OR <column_name> > DATE '9999-12-31'` in Oracle SQL Developer to locate rows with out-of-range DateTime values.
- 2In the Fabric copy activity, add a WHERE clause filter on the Oracle source query to exclude rows with invalid dates before they reach the .NET runtime.
- 3For columns with BC-era dates, add a transformation in the copy activity mapping to replace them with a sentinel value such as '1900-01-01' or NULL.
- 4If the column contains second values above 59 (Oracle allows leap seconds in some configurations), cast the column using TO_CHAR and then re-parse as a string in the sink.
- 5After filtering out the bad rows, decide whether to write them to a rejected-rows table using the copy activity's fault tolerance settings (skipIncompatibleRow) for audit purposes.
Beyond the docs
Common practitioner solutions not covered in the official documentation.
- 1Identify rows with out-of-range dates using: SELECT * FROM <table> WHERE <date_col> < DATE '0001-01-01'
- 2Cast the Oracle DateTime column to VARCHAR in the copy source query to bypass the conversion: TO_CHAR(<col>, 'YYYY-MM-DD HH24:MI:SS')
- 3Filter out or replace known out-of-range values at the source query level before they reach the copy sink
- 4If BC dates are business-critical, consider a custom transformation step before loading into the target