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.
OracleLob for CLOB/NLOB and BFILE
-
- Devart Team
- Posts: 1710
- Joined: Thu 03 Dec 2009 10:48
More information
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.
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.
-
- Devart Team
- Posts: 1710
- Joined: Thu 03 Dec 2009 10:48
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.
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.
-
- Devart Team
- Posts: 1710
- Joined: Thu 03 Dec 2009 10:48
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
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