1
問題: 過程的OUT變量未返回。ADO .NET OUT變量Oracle 10G與11G
背景: 我最近更新了一個從Oracle 10g到Oracle 11G的應用程序。我們正在使用Oracle客戶端的12c版本。
該應用程序在.NET 3.5上運行。
Database db = CreateDatabase(connectionName);
var dbCmd = db.GetStoredProcCommand(procedureName);
ConvertParams(ref dbCmd, parameters);
try
{
iReturn = db.ExecuteNonQuery(dbCmd, _transaction);
if (transaction == null) //if a transaction hasn't been passed, it isn't intended to has control over commit/rollback out of method, so app can do it
_transaction.Commit();
}
catch (Exception ex)
{
if (transaction == null)
_transaction.Rollback();
throw ex;
}
finally
{
DebugSpCommand(procedureName, parameters);
GetOutputParams(ref parameters, dbCmd);
if (transaction == null)
{
if (_transaction.Connection != null)
_transaction.Connection.Close();
_transaction.Dispose();
}
}
}
catch (OracleException ex)
{
Framework.ErrorHandling.ErrorHandler.HandleException(ex, "DATA_LAYER_POLICY");
Framework.Logging.Logger.Write(ex.Message, LogCategories.Debug);
iReturn = ex.Code;
}
catch (Exception ex)
{
Framework.ErrorHandling.ErrorHandler.HandleException(ex, "DATA_LAYER_POLICY");
Framework.Logging.Logger.Write(ex.Message, LogCategories.Debug);
}
的問題是,我出了PL/SQL程序中的變量是返回一個數,我的C#代碼在等一個字符。 由於某些原因,它正在使用Oracle 10G。 –