mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-11-09 10:55:02 +08:00
Oracle output cursor bug
This commit is contained in:
@@ -185,6 +185,13 @@ namespace OrmTest.Demo
|
|||||||
private static void Ado()
|
private static void Ado()
|
||||||
{
|
{
|
||||||
var db = GetInstance();
|
var db = GetInstance();
|
||||||
|
|
||||||
|
|
||||||
|
string spName = "PR_TEST";
|
||||||
|
var p1 = new SugarParameter("@O_RESULT", null, true);
|
||||||
|
p1.IsRefCursor = true;
|
||||||
|
var dt3 = db.Ado.UseStoredProcedure().GetDataTable(spName, p1);
|
||||||
|
|
||||||
db.Ado.BeginTran();
|
db.Ado.BeginTran();
|
||||||
var t1 = db.Ado.SqlQuery<string>("select 'a' from dual");
|
var t1 = db.Ado.SqlQuery<string>("select 'a' from dual");
|
||||||
var t2 = db.Ado.GetInt("select 1 from dual");
|
var t2 = db.Ado.GetInt("select 1 from dual");
|
||||||
|
|||||||
@@ -655,7 +655,10 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
foreach (var outputParameter in parameters.Where(it => it.Direction.IsIn(ParameterDirection.Output, ParameterDirection.InputOutput,ParameterDirection.ReturnValue)))
|
foreach (var outputParameter in parameters.Where(it => it.Direction.IsIn(ParameterDirection.Output, ParameterDirection.InputOutput,ParameterDirection.ReturnValue)))
|
||||||
{
|
{
|
||||||
var gobalOutputParamter = this.OutputParameters.Single(it => it.ParameterName == outputParameter.ParameterName);
|
var gobalOutputParamter = this.OutputParameters.FirstOrDefault(it => it.ParameterName == outputParameter.ParameterName);
|
||||||
|
if (gobalOutputParamter == null) {//Oracle bug
|
||||||
|
gobalOutputParamter=this.OutputParameters.FirstOrDefault(it => it.ParameterName == outputParameter.ParameterName.TrimStart(outputParameter.ParameterName.First()));
|
||||||
|
}
|
||||||
outputParameter.Value = gobalOutputParamter.Value;
|
outputParameter.Value = gobalOutputParamter.Value;
|
||||||
this.OutputParameters.Remove(gobalOutputParamter);
|
this.OutputParameters.Remove(gobalOutputParamter);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user