Microsoft Knowledge Base Email Alertz

(251238) - If metadata information changes at execution time, the following error occurs: Server: Msg 7356, Level 16, State 1, Line 1 OLE DB provider 'MSDAORA' supplied inconsistent metadata for a column. This error may occur when you use distributed queries in...

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 251238 - Last Review: July 14, 2004 - Revision: 3.2

PRB: Distributed Queries Return Error 7356 with MSDAORA

This article was previously published under Q251238

On This Page

SYMPTOMS

If metadata information changes at execution time, the following error occurs:
Server: Msg 7356, Level 16, State 1, Line 1
OLE DB provider 'MSDAORA' supplied inconsistent metadata for a column.
This error may occur when you use distributed queries in SQL Server that reference a view if you create the underlying table in Oracle under the following conditions:
  • You do not specify Nullability in the CREATE TABLE statement. -and-

  • You create a Primary Key using the ALTER TABLE statement -and-

  • You create a view that includes the PRIMARY KEY.

CAUSE

IDBSchemaRowset::GetRowset for DBSCHEMA_COLUMNS returns IS_NULLABLE as TRUE.

IColumnsInfo::GetColumnInfo on the rowset returns DBCOLUMNFLAGS_ISNULL as FALSE.

Because of the these discrepancies, distributed queries fail with the 7356 error.

The OLE DB provider, Msdaora.dll, returns the wrong information because the metadata that Oracle returns is incorrect.

RESOLUTION

Specify the Nullability of the column explicitly during the CREATE TABLE statement.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

Use these steps to reproduce the behavior:
  1. Create the test table using this code:
    CREATE TABLE MYDIST
          (GMI_ID  VARCHAR2(8)
          ,LAST_NAME VARCHAR2(20)
          ,FIRST_NAME VARCHAR2(20) )
    					
  2. Alter the table using this code:
       ALTER TABLE MYDIST
          ADD (CONSTRAINT MYDIST_PK PRIMARY KEY (GMI_ID))
    					
  3. Insert data into the table using this code:
       INSERT INTO MYDIST VALUES ('test1','row','one')
       INSERT INTO MYDIST VALUES ('test2','row','two')
    					
  4. Create a view using this:
       CREATE VIEW V_MYDIST1 AS
          SELECT GMI_ID FROM MYDIST
    					
  5. Create a linked server entry using the msdaora.dll file and execute the following query:
    select * from <OracleLinkedServer>..<SchemaName>.V_MYDIST1
    					
    The query returns this error:
    Server: Msg 7356, Level 16, State 1, Line 1
    OLE DB provider 'MSDAORA' supplied inconsistent metadata for a column. Metadata information was changed at execution time.

APPLIES TO
  • Microsoft OLE DB Provider for Oracle Server 1.0
  • Microsoft OLE DB Provider for Oracle Server 1.0
  • Microsoft SQL Server 7.0 Standard Edition
  • Microsoft SQL Server 7.0 Service Pack 1
Keywords: 
kbmdacnosweep kboracle kbprb KB251238
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate