cur_Out OUTPUT variable IN Oracle

I spent allmost all day spent to search how i return data as output parameter from oracle with the help of Data Access Application Block.
Ultimatly I got the answer.
Its only solution is the variable name should be cur_Out.

The sample code is given bellow.
-----------------------------------
CREATE OR REPLACE PROCEDURE sp_EmployeeGetAll
( cur_Out OUT SYS_REFCURSOR )
AS
BEGIN
OPEN p_Result FOR
SELECT EmpID, Name, JoinDate FROM Employee;
END;
/

The Dotnet code is
--------------------

Database db = new OracleDatabase(_connectionStr);
DbCommand command = db.GetStoredProcCommand(spName);


DataSet ds = new DataSet();
try
{
ds = db.ExecuteDataSet(command);
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine(ex.Message);
}

No comments: