OracleLob for CLOB/NLOB and BFILE
Posted: 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.
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.