This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--this code increases the price of all products | |
--in the category by 20% each time the script is run | |
--The result of the script is different each time the script is run. | |
UPDATE Product | |
SET Price = Price * 1.2 | |
WHERE CategoryId = 3001 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UPDATE Product SET Price = 12.95 WHERE ProductId = 1435 | |
UPDATE Product SET Price = 23.70 WHERE ProductId = 1436 | |
UPDATE Product SET Price = 31.95 WHERE ProductId = 1498 | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- the following external database with new prices should have ben created before execution of this script | |
/* | |
CREATE TABLE tmpProductPrices | |
( | |
ProductId int | |
, Price number(10,2) | |
) | |
*/ | |
UPDATE p |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dim yearGroup = New System.Collections.Hashtable() | |
Function GetGroupColor(groupName As String, color1 as string, color2 as string) As String | |
If yearGroup.ContainsKey(groupName) Then | |
Return yearGroup(groupName) | |
End If | |
Dim color = IIf(yearGroup.Count() Mod 2 = 0, color1, color2) | |
yearGroup.Add(groupName, color) |