Last updated on MAY 30, 2017
Applies to:Oracle Provider for OLE DB - Version 220.127.116.11 to 18.104.22.168 [Release 11.2]
Information in this document applies to any platform.
Executing a select query against a NVARCHAR2 column using the Oracle Provider for OLE DB 11.2 fails with:
Msg 7356, Level 16, State 1, Line 1
The OLE DB provider "OraOLEDB.Oracle" for linked server "LINKEDSERVERNAME" supplied inconsistent metadata for a column. The column "C1" (compile-time ordinal 1) of object ""SCHEMANAME"."TABLENAME"" was reported to have a "LENGTH" of <nn> at compile time and <nnn> at run time.
*Where <nn> is the actual size of the column defined in the database and <nnn> is a number double that size.
The error is specific to using the three part query syntax:
select count(*) from LINKEDSERVERNAME..SCHEMA.TABLENAME
Using OpenQuery works and can be utilized as a workaround:
select * from OpenQuery(LINKEDSERVERNAME,'SELECT COUNT(*) FROM SCHEMA.TABLENAME')
Upgraded the Oracle Provider for OLE DB to 22.214.171.124.0.
Sign In with your My Oracle Support account
Don't have a My Oracle Support account? Click to get started
Million Knowledge Articles and hundreds of Community platforms