1

I have a problem when I called Oracle stored procedure. I also used InsightDbConnection with method Execute, when I input the outputParameter is an object but it still empty.

Here is my code

var storedProcedureName = "spTest";
object param = new { P_Param1 = "",//output parameter
                     P_Param2 = "Input parameter"
                   };
object output = new {P_Param1 = ""};
IDbConnection  dbConnect = new OracleConnection(connectionString).OpenConnection();
dbConnect .Execute(storedProcedureName , param , outputParameters: output);

Anybody can help me, please.

tahter
  • 31
  • 1
  • 5

1 Answers1

0

Your output object is an anonymous types. In c#, the properties of anonymous types are read-only and cannot be changed once they are created.

There is a test case that shows how to use output parameters with oracle:

https://github.com/jonwagner/Insight.Database/blob/734a3e09fa3c7ae3b8ac63fc8c49f8fcb4bd3fa5/Insight.Tests.OracleManaged.Core/OracleTests.cs#L79

Jon Wagner
  • 667
  • 4
  • 6