My Oracle Support Banner

Error "Could not execute query against OLE DB provider 'OraOLEDB.Oracle'" when Querying Against an Oracle Database using Microsoft SQL Server Linked Server and the Oracle Provider for OLE DB (Doc ID 333327.1)

Last updated on MARCH 06, 2025

Applies to:

Oracle Provider for OLE DB - Version 10.2.0.1 and later
Microsoft Windows (32-bit)


Symptoms

You are unable to connect to the Oracle database when using Microsoft SQL Server's Linked Server and the Oracle Provider for OLE DB. When issuing the following query from Microsoft's SQL Query Analyzer   

SELECT * FROM DEV..SCOTT.EMP

You receive the following error

Server: Msg 7320, Level 16, State 2, Line 1
  Could not execute query against OLE DB provider 'OraOLEDB.Oracle'.
  OLE DB error trace [OLE/DB Provider 'OraOLEDB.Oracle' ICommandText::Execute returned 0x80040155].

 

If you change the query so that it will not return any rows it runs successfully

SELECT * FROM DEV..SCOTT.EMP where 1=0

Changes

 

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Changes
Cause
Solution
References

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.