diff --git a/Src/Asp.Net/OracleTest/Demos/1_Query.cs b/Src/Asp.Net/OracleTest/Demos/1_Query.cs index 620345864..2596d279b 100644 --- a/Src/Asp.Net/OracleTest/Demos/1_Query.cs +++ b/Src/Asp.Net/OracleTest/Demos/1_Query.cs @@ -185,6 +185,13 @@ namespace OrmTest.Demo private static void Ado() { 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(); var t1 = db.Ado.SqlQuery("select 'a' from dual"); var t2 = db.Ado.GetInt("select 1 from dual"); diff --git a/Src/Asp.Net/SqlSugar/Abstract/AdoProvider/AdoProvider.cs b/Src/Asp.Net/SqlSugar/Abstract/AdoProvider/AdoProvider.cs index 41891ab39..f89c140d3 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/AdoProvider/AdoProvider.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/AdoProvider/AdoProvider.cs @@ -655,7 +655,10 @@ namespace SqlSugar { 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; this.OutputParameters.Remove(gobalOutputParamter); }