如何使用OleDb读取Oracle中的CLOB列?

Thi*_*ise 6 .net oracle oledb clob

我在Oracle 10g数据库上创建了一个具有以下结构的表:

create table myTable
(
id       number(32,0)      primary key,
myData   clob
)
Run Code Online (Sandbox Code Playgroud)

我可以在表中插入行没有任何问题,但是当我尝试使用OleDb连接从表中读取数据时,我得到一个异常.

这是我使用的代码:

using (OleDbConnection dbConnection = new OleDbConnection("ConnectionString"))
{
    dbConnection.Open();

    OleDbCommand dbCommand = dbConnection.CreateCommand();

    dbCommand.CommandText = "SELECT * FROM myTable WHERE id=?";
    dbCommand.Parameters.AddWithValue("ID", id);

    OleDbDataReader dbReader = dbCommand.ExecuteReader();
}
Run Code Online (Sandbox Code Playgroud)

异常详细信息似乎指向不受支持的数据类型:

System.Data.OleDb.OleDbException: 
Unspecified error Oracle error occurred, but error message could not be retrieved from Oracle. 
Data type is not supported.
Run Code Online (Sandbox Code Playgroud)

有谁知道如何使用OleDb连接读取这些数据?

PS:在这种情况下使用的驱动程序是Microsoft.

Col*_*ard 5

我不确定是否可以将CLOB类型与Microsoft OLEDB驱动程序一起使用.

你必须使用微软吗?您可以更好地使用Oracle Provider for OLE DB或更好地使用Oracle Data Provider for .NET(ODP.NET).