Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Rally00
Frequent Visitor

ODBC Redshift

Hi everyone
I have a problem with an ODBC connection from Redshift.
Once connected, for some tables, it is not possible to load them in direct query due to a conflict between the format of some
table columns and the data they contain
In particular fields that have the format INT and have "" values.

Below is the error:

DataSource.Error: ODBC: ERROR [22P02] [Microsoft][Amazon Redshift] (30) Error occurred while trying to execute a query: [SQLState 22P02] ERROR: invalid input syntax for integer: ""

Dettagli:
DataSourceKind=AmazonRedshift
DataSourcePath=loit-it0406172-prod-rshift-01fe-workgroup.925654835947.eu-central-1.redshift-serverless.amazonaws.com;dre2bi1prod
OdbcErrors=[Table]

Can you help me?
Thank you
Domenico

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Rally00 ,

 It appears that the issue arises because Redshift expects an integer value, but an empty string is provided instead. This mismatch in data types causes the error.

If possible, consider cleansing your data before it's queried. This could involve updating the source data to ensure that all fields expected to be integers do not contain empty strings or non-numeric values. This approach requires access to the source data and the ability to modify it.

Once you make selections from the Navigator window, you can either Load or Edit the data.

  • If you choose to Load data, you'll be prompted to use either Import or DirectQuery mode to load the data. For more information, check out this article that explains DirectQuery.
  • If you select to Edit the data, Query Editor appears where you can apply all sorts of transformations and filters to the data, many of which are applied to the underlying Amazon Redshift database itself (if supported).

Best Regards,

Xianda Tang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @Rally00 ,

 It appears that the issue arises because Redshift expects an integer value, but an empty string is provided instead. This mismatch in data types causes the error.

If possible, consider cleansing your data before it's queried. This could involve updating the source data to ensure that all fields expected to be integers do not contain empty strings or non-numeric values. This approach requires access to the source data and the ability to modify it.

Once you make selections from the Navigator window, you can either Load or Edit the data.

  • If you choose to Load data, you'll be prompted to use either Import or DirectQuery mode to load the data. For more information, check out this article that explains DirectQuery.
  • If you select to Edit the data, Query Editor appears where you can apply all sorts of transformations and filters to the data, many of which are applied to the underlying Amazon Redshift database itself (if supported).

Best Regards,

Xianda Tang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.