1

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

2 Answers 2

2

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.

Sign up to request clarification or add additional context in comments.

Comments

1
DbCommand command = db.GetStoredProcCommand( sprocName );
command.Parameters.Add( new OracleParameter( "out_value", OracleDbType.Int32, ParameterDirection.Output ) );

db.ExecuteNonQuery( command );

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.