OracleLob for CLOB/NLOB and BFILE

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
lfmacias
Posts: 3
Joined: Wed 12 Jul 2006 21:21

OracleLob for CLOB/NLOB and BFILE

Post by lfmacias » Wed 23 Jun 2010 16:07

I have a table :

CREATE TABLE "HELLO"
( "BLOBCOLUMN" BLOB,
"BFILECOLUMN" BFILE,
)


I use the following code in order to query this.

this.oracleCommand.CommandText = "select * from HELLO";
oracleDataTable.SelectCommand = this.oracleCommand;
this.oracleDataTable.Active = true;
DataColumnCollection d = oracleDataTable.Columns;

foreach (DataColumn var in d)
{
System.Console.WriteLine("Name :"+var.ColumnName + " Type "+ var.DataType.ToString());

}

The output shows :

Name :BLOBCOLUMN Type CoreLab.Oracle.OracleLob
Name :BFILECOLUMN Type CoreLab.Oracle.OracleLob

As you can see there is no diference between BLOBCOLUMN and BFILECOLUMN meaning that those columns are the same type.

Now suppose i got the BFILECOLUMN cell value and it is empty using something like this

CoreLab.Oracle.OracleLob vale = (OracleLob)this.myGrid.getCellValue(index, myBFILEColumn);

if ((vale.LobType == OracleDbType.Blob))
{
// allways is BLOB
}
else if (vale.LobType == OracleDbType.BFile)
{
// Never in here
// I need to do something here when the Colums is a BFILE but i'cant
}

Because the BFILEColumn value is null, allways is treated like Blob, What other option i have in order to make difference between those Fields?

In fact CLOB, NLOB and BFILE are treated as the same until those got a value.

StanislavK
Devart Team
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Post by StanislavK » Thu 24 Jun 2010 16:46

I've tried running your sample with the latest version of dotConnect for Oracle, and both empty LOBs were of the BFile type. We will investigate the situation and inform you about the results.

lfmacias
Posts: 3
Joined: Wed 12 Jul 2006 21:21

More information

Post by lfmacias » Fri 25 Jun 2010 01:00

Ok,take a look below, this is my table

CREATE TABLE "SPATIAL"."HELLO"
( "BLOBCOLUMN" BLOB,
"COLUMN1" VARCHAR2(200),
"CLOBCOLUMN" CLOB,
"BFILECOLUMN" BFILE,
"COLUMN4" BINARY_DOUBLE,
"NLOBCOLUMN" NCLOB
)

When print the information of the columns:

foreach (DataColumn var in d)
{
System.Console.WriteLine("Column Name: " + var.ColumnName +" Column Type :"+ var.DataType);
}

so the output is :

Column Name: BLOBCOLUMN Column Type :CoreLab.Oracle.OracleLob
Column Name: COLUMN1 Column Type :CoreLab.Oracle.OracleString
Column Name: CLOBCOLUMN Column Type :CoreLab.Oracle.OracleLob
Column Name: BFILECOLUMN Column Type :CoreLab.Oracle.OracleLob

As you can see BLOB, CLOB,BFILE are CoreLab.Oracle.OracleLob, there is no way to know what type of column are, until those have information.

StanislavK
Devart Team
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Post by StanislavK » Fri 25 Jun 2010 16:33

We are investigating the situation. The expected behaviour is that
a) column types are OracleLob for the CLOB and BLOB columns, and OracleBFile for the BFile column;
b) CLOB and BLOB columns can be distinguished by their LobType property.

We will inform you about the results when our investigation is completed.

StanislavK
Devart Team
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Post by StanislavK » Thu 29 Jul 2010 13:15

We've fixed the problem with incorrect LobType properties, the fix is available in the latest 5.70.152 build. The build can be downloaded from
http://www.devart.com/dotconnect/oracle/download.html
(the trial version) or from Registered Users' Area (provided that you have an active subscription):
http://secure.devart.com/

For more information on improvements and fixes available in dotConnect for Oracle 5.70.152, please refer to
http://www.devart.com/forums/viewtopic.php?t=18588

Post Reply