on 12-02-2015 5:33 PM
Hi Experts ,
I am using the below OData service :
http://services.odata.org/V2/(S(u0fm33whthkboho0u01zhgyh))/OData/OData.svc
Using this Odata service I am able to Perform CREATE , READ , UPDATE , DELETE but only one record at a time .
eg: for creating a new record I am using the below code :
var oModel = new sap.ui.model.odata.ODataModel("proxy/http/services.odata.org/V2/(S(u0fm33whthkboho0u01zhgyh))/OData/OData.svc", true);
oModel.create("/Products",{
ID: "11",
Name: "Honey",
Description: "Healthy"
},{
success: function()
{
alert("success");
},
error: function(){
alert("failure");
}
});
Now My requirement is to create multiple records , update multiple records , Delete multiple records at a time . Can anybody help with code for this same example .
Thanks
Rizwan
Hi,
OData does not have such concept - the best you can do is to use $batch which is terribly slow (not just slow but rather shocking slow) to submit multiple "requests" at once in a multipart/boundary type of form. One can create a batch for different operations.
Alternatively, the OData v2 supports a "create deep" which means you can create inner entities on the same request.. this way you could create a "new" entity say "ProductBatch" which is a collection of Products and nothing else and use such in a create deep operation sending a lot of products at once. While this approach is "not correct" - it's the only viable option as far I'm aware if you're not happy with general performance of the Gateway System, most of all dealing with $batch requests.
Hope it helps,
Dan.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.