on 07-14-2015 7:10 AM
Hi Folks,
I am struggling through inserting/updating datetime filed in MS SQL Server through OData service in my native android app.
i tried it by passing the hard code value "2015-07-05T12:00:00" but it does not work. I also tried to convert it into datetime format but no success.
Could you please help me in getting the right format for inserting datetime in my MS SQL database through OData service?
There is one more issue that when i am inserting or updating the value, the status code in response is 500 or Error. I am not getting the correct response from the server but my DB is getting updated.
I am unable to find the reason why the status code of response from server is 500 or Error? Could you please help me in this?
Thanks & Regards,
Deepak Sharma
Hi Deepak,
Could you please share below info:
1.SMP server version? e.g. 3.0 SP08
2. Have you exposed MS-SQL server (DB) info into OData service via Integration Gateway?
3.if yes, "SAP Mobile Platform Tools" plugin version?
4. What is datatype of backend column?
5. What about value Type of property in OData model? Have you selected Edm.DataTime?
Does this discussion make sense ?
Regards,
JK
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi JK,
Thanks for the quick response. Below are the following info :-
1.SMP server version?
3.0 SP05
2. Have you exposed MS-SQL server (DB) info into OData service via Integration Gateway?
YES
3.if yes, "SAP Mobile Platform Tools" plugin version?
SQL JDBC4-4.0.jar
4. What is datatype of backend column?
DateTime
5. What about value Type of property in OData model? Have you selected Edm.DataTime?
Yes In OData model it is Edm.DateTime
Actually i was trying to solve it by converting date value into Edm.DateTime by using ODataMetaProperty.EDMType.DateTime from front end but could not succeed.
Is there a way to convert date into Edm.DateTime from front-end?
Thanks & Regards,
Deepak
Before testing it from front-end, did you try if you were able to succeed in inserting data for the odata service using rest client?
Hi JK,
The issue is resolved. Now, I am able to insert date and time in my SQL Server database through ODATA.
Actually i tried it using dateTime, dateTimeOffset, long and Calendar by getting its instance.
But instead of simple calendar we have to use the Gregorian Calendar. So, I used Gregorian and it worked.
Thanks for your Quick response and help.
regards,
Deepak
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.