GO DIRECTLY TO
My Oracle Support Community
Oracle Technology Network
Windows and .NET
Please enter a title.
You can not post a blank message. Please type your message and try again.
This discussion is archived
: Apr 3, 2013 12:23 AM by zeroid
EF execution of stored procedure with DATE parameter loses hours/minutes
Apr 3, 2013 12:23 AM
Currently Being Moderated
I have a simple stored procedure using DATE as an input:
CREATE OR REPLACE PROCEDURE delete_time(myTime DATE) IS
DELETE FROM mytable WHERE time = myTime;
This has been added to my EDMX using a function import, and the types mapped are Date on the SSDL side and DateTime on the CSDL.
The problem is when I run the procedure from .NET using a DateTime the hours and minutes are lost somewhere along the way:
DateTime dt = new DateTime(2013, 4, 3, 12, 15, 00);
var timeParam = new ObjectParameter("myTime", dt) :
return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("DeleteTime", timeParam);
This runs the stored procedure but deletes the rows where TIME = 03-APR-2013 00:00:00 instead of 03-APR-2013 12:15:00
Is there some bug in the Oracle client (I'm using 188.8.131.52.20)? Or am I doing something wrong above?
I also tried using TIMESTAMP as the input type of my procedure, but then I get this error when calling the function:
ORA-01830: date format picture ends before converting entire input string
Track in Communications
- 10 points
- 5 points