Odbc data provider is not support blob data type at DB2. I suggest you OleDB data provider.
Unknown SQL type - -98( because of Blob data from db2)
-
05-10-2022 - |
Question
I use db2 database with Odbc data provider and Telerik Report Designer Q3 2013. I have a table which has a blob data of a picture. When I tried to select it, I take an error "Unknown SQL type - -98". I can't find any documentation or solution about it. Can you please help?
Error Screen Shot
Solution
OTHER TIPS
As suggested, ODBC .Net data provider doesn't support this, but there is a workaround if you look here
...
Workaround
Set the CLI/ODBC LongDataCompat keyword to 1. Doing so will force the CLI driver to make the following data type mappings to data types the ODBC .NET Data Provider will understand:
- SQL_CLOB to SQL_LONGVARCHAR
- SQL_BLOB to SQL_LONGVARBINARY
- SQL_DBCLOB to SQL_WLONGVARCHAR
To set the LongDataCompat keyword, run the following DB2 command from a DB2 command window on the client machine: db2 update cli cfg for section common using longdatacompat 1 You can also set this keyword in your application, using the connection string as follows:
[C#]
OdbcConnection con = new OdbcConnection("DSN=SAMPLE;UID=uid;PWD=mypwd; LONGDATACOMPAT=1;");
For a list of all the CLI/ODBC keywords, refer to the "UID CLI/ODBC configuration keyword".