Hello,
I use dotConnect Universal to connect to Oracle server in Direct mode.
I try select Blob data from table (select blobfield from testTable where id=xxxx):
1. in direct mode - it's return empty DataReader (HasRows==false)
2. in NOT direct mode - it's return valid DataReader (with data, HasRows==true)
I try get BLOB data using out parameter of stored proc:
1. in direct mode - it's return error "data not found"
2. in NOT direct mode - it's return valid Blob data
Is it limitation of Oracle Direct mode?
I read http://www.devart.com/dotconnect/oracle ... tMode.html, but there is no info about limitation on Blob fields.
Best regards,
Artyom.
Can I work with Oracle Blob using Oracle Direct mode
I have tried to reproduce the problem with the following code using the 3.20.25 version of dotConnect Universal. It works. Please try:
DDL
C# code
Here is my output:
reader.HasRows = True
Parameter is NOT null.
Please tell us the version (x.xx.xxx) and edition of your dotConnect Universal and the way we should modify this sample to reproduce the issue.
DDL
Code: Select all
create table blobtable(
id number,
blobfield blob);
//insert some data into blobtable
create or replace procedure getblobfield(param out blob)
is
begin
select blobfield into param from blobtable where id=1;
end;
Code: Select all
static void UseReader()
{
using (UniConnection conn = new UniConnection()) {
conn.ConnectionString = "Provider=Oracle;server=***;port=1525;SID=***;Direct=true;uid=scott;pwd=tiger;";
conn.Open();
UniCommand cmd = conn.CreateCommand();
cmd.CommandText = "select blobfield from blobtable where id=1";
UniDataReader reader = cmd.ExecuteReader();
Console.WriteLine("reader.HasRows = {0}", reader.HasRows);
}
}
static void UseStoredProc()
{
using (UniConnection conn = new UniConnection()) {
conn.ConnectionString = "Provider=Oracle;server=***;port=1525;SID=***;Direct=true;uid=scott;pwd=tiger;";
conn.Open();
UniCommand cmd = conn.CreateCommand();
cmd.CommandType = System.Data.CommandType.StoredProcedure;
cmd.CommandText = "getblobfield";
cmd.Parameters.Add("param", UniDbType.Blob).Direction = System.Data.ParameterDirection.Output;
cmd.ExecuteNonQuery();
if (cmd.Parameters["param"].Value != null)
Console.WriteLine("Parameter is NOT null.");
else
Console.WriteLine("Parameter IS null.");
}
}
static void Main(string[] args)
{
UseReader();
UseStoredProc();
Console.ReadLine();
}
reader.HasRows = True
Parameter is NOT null.
Please tell us the version (x.xx.xxx) and edition of your dotConnect Universal and the way we should modify this sample to reproduce the issue.