Page 1 of 1

Can I work with Oracle Blob using Oracle Direct mode

Posted: Mon 01 Nov 2010 08:55
by ArtyomZzz
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.

Posted: Tue 02 Nov 2010 14:29
by Shalex
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

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;
C# code

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();
        }
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.

Posted: Wed 03 Nov 2010 06:46
by ArtyomZzz
Hello,

Cause of the problem is that I use Label Security on Oracle table. And in direct mode I have problem from my first post. I want to refuse from using Label Security for a long time and now I have yet one another reason for that.

Thank you for your respond!

Best regards,
Artyom.