How to use update query in OQL browser????????????
Give some examples
anyone help me,
regards,
vignesh
3 Answers, 1 is accepted
0
Alexander
Telerik team
answered on 05 May 2009, 10:50 AM
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.
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();
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.