Kbase P126779: SQL: Data truncated and Invalid long datatype and error (7682) retrieving a BLOB column.
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  09/03/2009 |
|
Status: Verified
SYMPTOM(s):
SQL: Data truncated and Invalid long datatype and error (7682) retrieving a BLOB column.
Trying to retrieve the BLOB column directly using a statement like SELECT Blob_Column FROM PUB.TableName generates the error:
OLE DB provider "MSDASQL" for linked server "PROGRESS" returned message "[DataDirect][ODBC Progress OpenEdge Wire Protocol driver]Data truncated, column 2.".
Msg 7399, Level 16, State 1, Line 1
The OLE DB provider "MSDASQL" for linked server "PROGRESS" reported an error. The provider ran out of memory.
Msg 7330, Level 16, State 2, Line 1
Cannot fetch a row from OLE DB provider "MSDASQL" for linked server "PROGRESS".
Trying to retrieve the BLOB column indirectly by casting it to another data type using a statement like SELECT CAST(Blob_Column AS CHARACTER) FROM PUB.TableName generates the error:
OLE DB provider "MSDASQL" for linked server "PROGRESS" returned message "[DataDirect][ODBC Progress OpenEdge Wire Protocol driver][OPENEDGE]Invalid long datatype column reference (7682)".
Msg 7321, Level 16, State 2, Line 1
An error occurred while preparing the query "select { fn convert(docImage, SQL_LONGVARBINARY) } as Fld from pub."promoType" where "promoTypeId" = 508" for execution against OLE DB provider "MSDASQL" for linked server "PROGRESS".
Using the MSDASQL to access a Progress database through the OpenEdge ODBC driver.
FACT(s) (Environment):
Windows
OpenEdge 10.1B
CAUSE:
MSDASQL will not specify the correct size on SQLGetData calls.
FIX:
Add the string value WorkArounds2 with a value of 256 in the registry section or the .DSN file for the data source:
1. If a USER ODBC Data Source is being used, then select the following registry key:
HKEY_CURRENT_USER\Software\ODBC\OBDC.INI\<YourDataSourceName>
2. If a SYSTEM ODBC Data Source is being used, then select the following registry key:
HKEY_LOCAL_COMPUTER\Software\ODBC\OBDC.INI\<YourDataSourceName>
Right click on the data source and select 'Edit', 'New', 'String Value'. Set the name of
the new string to 'WorkArounds2' and set its value to 256.
3. If a FILE ODBC Data Source is being used, then edit the file to add the new option and save the changes.