I have (simplified) Oracle SQL:
declare
xd number;
xm number;
DataOut sys_refcursor;
begin
xd := to_number(to_char(sysdate, 'dd'));
xm := to_number(to_char(sysdate, 'mm'));
open DataOut for
select * from dual;
end;
And I want to be able to populate a DataTable in .Net from the data returned in the DataOut parameter.
I tried different things but cannot access the DataOut cursor. How can I call it?
OracleCommand c = new OracleCommand();
c.CommandType = CommandType.Text;
c.CommandText = SQL;
OracleParameter param = new OracleParameter();
param.Direction = ParameterDirection.Output;
param.OracleType = OracleType.Cursor;
param.ParameterName = "DataOut";
c.Parameters.Add(param);
c.Connection = (OracleConnection) this.GetConnection();
OracleString rowNum = "";
c.ExecuteOracleNonQuery(out rowNum);
DataTable returnTable =
I can edit SQL, but I cannot create functions or procedures. Is it possible?
source
share