重複の可能性:
この CLOB フィールドの GetOrdinal 関数で OutOfRange 例外が発生するのはなぜですか?
I need to read a CLOB field from an ORACLE table int a C# variable of type String. Does anyone know how to accomplish this task?
これは私が行ったことですが、フィールドの GetOrdinal を計算するときに IndexOutofRange を取得しています。前もって感謝します。
public void ReadFunction(string FName, out string fContent)
{
OracleCommand command = _connection.CreateCommand();
OracleTransaction transaction = _connection.BeginTransaction();
command.Transaction = transaction;
command.CommandText = "SELECT TO_CLOB(TO_NCLOB(FUNCTION_SCRIPT)) FROM IS_FUNCTION where FNAME=:fName ";
command.Parameters.Add("FName", OracleType.NVarChar).Value = FName;
OracleDataReader odr = command.ExecuteReader();
int temp = odr.GetOrdinal("FUNCTION_SCRIPT");
OracleLob myLob = odr.GetOracleLob(temp);
fContent = (String)myLob.Value;
odr.close();
}