2

We have a problem with a query from a SQL Server 2008R2 - 64bit to an Oracle Linked Server.

We use the Oracle 64-bit driver for Windows.

When we query a certain table we get the following error:

Msg 7347, Level 16, State 1, Line 1 OLE DB provider 'OraOLEDB.Oracle' for linked server 'SERV_VISION2' returned data that does not match expected data length for column '[SERV_VISION2]..[VISION].[INV_M001].CUS_NM'. The (maximum) expected data length is 30, while the returned data length is 24.

The problem seems to be the data in the CUS_NM column. In the rows where he gives this error the data is like this:

¿¿¿         

So like a question mark but upside down. There doesn't seem to be a problem with the length of the column, for one reason he can't handle this data I guess.

Did anyone experience this problem? Anyone a clue how to solve this?

migrated from stackoverflow.com Nov 17 '11 at 14:11

This question came from our site for professional and enthusiast programmers.

2

That's most likely an NLS (language) problem and you've got customer names with characters your database cannot handle. You'll need to determine the actual type of the CUS_NM column in the Oracle database.

0

Oracle object names are all uppercase by default. The linked-server query must exactly match the case of all referenced Oracle metadata, such as schema and table names.

-3

Try below way-

CAST(CUS_NM AS VARCHAR(50))

here casting can vary as per your data type.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy