Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> C# and Oracle 8i - returns from stored procedures

C# and Oracle 8i - returns from stored procedures

From: Bret <bret.colburn_at_lmco.com>
Date: 27 Jan 2005 09:57:43 -0800
Message-ID: <1106848663.578907.176310@c13g2000cwb.googlegroups.com>


I'm accessing a stored procedure that returns two parameters, the first is a string and the second is a cursor. I get the cursor data but not the string. Any ideas?

Current code as follows :

OracleConnection conn = new OracleConnection(connString); DataSet myDataSet = new DataSet();
conn.Open();
OracleCommand cmd = conn.CreateCommand();

cmd.CommandText = "dag_select.mpe_list";
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("p_mtype",OracleType.LongVarChar,32).Value = "";
cmd.Parameters.Add("p_mname",OracleType.LongVarChar,32).Value = "";

// length included in next Add because I was getting exceptions without
it
cmd.Parameters.Add("p_rc",OracleType.LongVarChar,50).Direction = ParameterDirection.Output;
cmd.Parameters.Add("p_rowset",OracleType.Cursor).Direction = ParameterDirection.Output;
OracleDataAdapter adapt = new OracleDataAdapter(cmd); adapt.Fill(myDataSet);
// at this point I thought I'd have two tables in my dataset, the first
containing only the string from the first parameter, the second containing the cursor data. I'm only getting one table and it contains the cursor data.

for (int count = 0; count < myDataSet.Tables[0].Rows.Count; count++) {
// process rows from cursor

}

More info:
using C#.net, Oracle 8i, Windows 2000 Received on Thu Jan 27 2005 - 11:57:43 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US