This is the sample of my code. The field FUNCTION_SCRIPT is a CLOB field (the only CLOB field) in my table IS_FUNCTION
public void ReadFunction(string FName
Try this
command.CommandText = "SELECT TO_CLOB(TO_NCLOB(FUNCTION_SCRIPT)) AS FUNCTION_SCRIPT FROM IS_FUNCTION where FNAME=:fName ";
Right now your query does not have a name because you've applied a function to the name so you need to ALIAS it to give it a name e.g AS FUNCTION_SCRIPT
OracleDataReader odr = command.ExecuteReader();
if(odr.HasRows)
{
int temp = odr.GetOrdinal("FUNCTION_SCRIPT");
OracleLob myLob = odr.GetOracleLob(temp);
fContent = (String)myLob.Value;
}
else
throw new Exception("No rows returned from database");