Expression support for Update

Sep 23, 2013 at 7:14 PM
Hi does the library support expressions for update parameters. an example query will be,
Update employees set Salary=Salary-4000
Sep 28, 2013 at 10:49 AM
Edited Sep 28, 2013 at 10:50 AM
Yep - anywhere you see a DBClause parameter you can substitute any of the calculations, comparisons, fields etc.

So for your example....

DBQuery upd = DBQuery.Update("MyTable")
                     .Set("Salary", DBField.Field("Salary") - DBConst.Int32(4000));
Would come out as ...
UPDATE [MyTable]
     SET [Salary] =  ([Salary] - 4000) ;
Oct 7, 2013 at 6:04 PM
Cool Thanks a lot for that. And Above all thanks a lot for this gem of a library. Keep it up.