3 Answers, 1 is accepted
0
Hello kottu,
OQL does not have an UPDATE statement. Although it looks like SQL, OQL is object oriented and you should use the objects directly to change their data.
Sincerely yours,
Alexander
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
OQL does not have an UPDATE statement. Although it looks like SQL, OQL is object oriented and you should use the objects directly to change their data.
Sincerely yours,
Alexander
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0

kottu
Top achievements
Rank 1
answered on 06 May 2009, 04:33 AM
Can you give Some examples?????????????
thanks,
regards,
vicky
thanks,
regards,
vicky
0
Hi kottu,
With OQL you can retrieve an object, modify it as you wish and then store it back to the database. Here is an example:
As you see OQL is used only for retrieving data. This is why you cannot use the OQL Query browser to update data. There you can only test if your OQL Select statement returns the desired result.
Greetings,
Alexander
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
With OQL you can retrieve an object, modify it as you wish and then store it back to the database. Here is an example:
IObjectScope scope = ObjectScopeProvider1.GetNewObjectScope(); |
scope.Transaction.Begin(); |
//retrieve an object using its id |
Order order = (Order)scope.GetOqlQuery("Select * from OrderExtent Where OrderID = 10248").Execute()[0]; |
//make some modifications to the object |
order.Freight++; |
//store the modified object |
scope.Transaction.Commit(); |
Greetings,
Alexander
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.