Search code examples
.netoracle-databaseoutput-parameter

How do I get Oracle output variable data in .net


I am working with Oracle in .net using the ODP.NET. I was wondering how I get the variables from an out variable when calling a stored procedure.

What I have currently is...

using(IDataReader reader = defaultDB.ExecuteReader("CalledStoredProc", new object[]{"InputVar", "OutPutVar"}))
{
    //Display the rows for the reader.
    DisplayRowVals(reader);
}

If you guys have any suggestions I would definitely appreciate it.
Thanks, Derek


Solution

  • You actually call the stored procedure with an additional parameter of type Cursor with direction of Output.

    Your stored procedure populates the cursor, and then you iterate over the (now modified) parameter in your DAL.