DataSource.Error: ODBC: ERROR [HY000] Specified cast is not valid.

  • 31 July 2023
  • 1 reply


DataSource.Error: ODBC: ERROR [HY000] Specified cast is not valid.  i have 8 table in my database but if i connect to a specific table then it gives this error                                                                                                           DataSource.Error: ODBC: ERROR [HY000] Specified cast is not valid.
    DataSourcePath={"dsn":"CData Power BI MongoDB"}


Best answer by Elizabeth G 1 August 2023, 15:43

View original

1 reply

Userlevel 3

@avtar Thank you for reaching out. This typically indicates that there is an issue with casting or determining data types. As the driver uses row scanning to determine what columns are present and what data types they have, if a column does not have a value of a data type in the first RowScanDepth rows, it may incorrectly the data type of the column. Could you please increase the RowScanDepth, which will cause more rows to be scanned, and should assist if the driver is incorrectly determining the data type? The documentation on this property is linked below.

If the issue persists, as this issue appears to be more technical in nature, it would be helpful to have logging to troubleshoot this further. Please reach out to our support team at, who will be able to assist with this further.