OracleConnection oracleConnection = new OracleConnection("----connectionstring----"); OracleCommand cmd = new OracleCommand(); // create the command for the stored procedure cmd.Connection = oracleConnection; cmd.CommandText = "REPORT.SP_SUBREPORT"; cmd.CommandType = CommandType.StoredProcedure; //cmd.Parameters.Add("Id", OracleType.Number).Value = 26; cmd.Parameters.Add("Id", OracleType.Number).Value = 26; cmd.Parameters.Add("returndata", OracleType.Cursor).Direction = ParameterDirection.Output; OracleDataAdapter da = new OracleDataAdapter(cmd); DataSet ds = new DataSet(); da.Fill(ds);
CREATE OR REPLACE PACKAGE REPORT AS TYPE T_CURSOR IS REF CURSOR; PROCEDURE SP_SUBREPORT ( ScoreCardMetricId IN NUMBER, returndata OUT T_CURSOR ); END REPORT; CREATE OR REPLACE PACKAGE BODY REPORT AS PROCEDURE SP_SUBREPORT ( ScoreCardMetricId IN NUMBER, returndata OUT T_CURSOR ) IS BEGIN OPEN returndata FOR SELECT -----------long list of statement----WHERE ID = Id ORDER BY ---statement----; END SP_SUBREPORT; END REPORT;
{System.Data.OracleClient.OracleException (0x80131938): ORA-04063: ORA-06508: PL/SQL: could not find program unit being called: "" ORA-06512: at line 1
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)