[Mono-bugs] [Bug 480377] System.Data.OracleClient : DataReader does not support System.TimeSpan
bugzilla_noreply at novell.com
bugzilla_noreply at novell.com
Fri Feb 27 10:05:10 EST 2009
https://bugzilla.novell.com/show_bug.cgi?id=480377
User webservices at landmarkdigital.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=480377#c1
--- Comment #1 from WebServices Group <webservices at landmarkdigital.com> 2009-02-27 08:05:09 MST ---
Sorry, I accidentally submitted the bug before I could finish the description.
Example Oracle procedure:
PROCEDURE SUBTRACT_TWO_DATES ( ret_cur OUT SYS_REFCURSOR )
AS
time1 DATETIME := '01-FEB-09 12:00:00 AM';
time2 DATETIME := '02-FEB-09 12:00:00 AM';
BEGIN
OPEN ret_cur FOR
SELECT (time2 - time1) FROM DUAL;
END;
C# code consists of merely invoking the procedure then attempting to read the
cursor with a DataReader:
System.Data.OracleClient.OracleCommand cmd = new
System.Data.OracleClient.OracleCommand();
cmd.CommandType = System.Data.CommandType.StoredProcedure;
cmd.CommandText = "SUBTRACT_TWO_DATES";
cmd.Connection = myConnection; // you'll have to create myConnection first...
System.Data.OracleClient.OracleParameter ret_cur_param = new
System.Data.OracleClient.OracleParameter();
ret_cur_param.ParameterName = "ret_cur";
ret_cur_param.OracleType = System.Data.OracleClient.OracleType.Cursor;
ret_cur_param.Direction = System.Data.ParameterDirection.Output;
ret_cur_param.Value = System.DBNull.Value;
cmd.Parameters.Add(ret_cur_param);
cmd.ExecuteNonQuery();
System.Data.DataTable myTable = new System.Data.DataTable("ret_cur");
using (System.Data.OracleClient.OracleDataReader reader = new
System.Data.OracleClient.OracleDataReader(ret_cur_param.Value)) {
myTable.Load(reader); // blows up here when an INTERVAL is in the result
set
}
I apologize if there are miscellaneous typos or syntax errors above; it is
hand-typed
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
More information about the mono-bugs
mailing list