Hi all,
I *have* tried the "Case When..." statement, but it does not seem to do what I want--I'm looking for something like the VB SELECT CASE block, and the Case/When seems to behave in a fundamentally different way.
Here is pseudocode using IF/ELSE of what I want--However I want to do this *without* IF/ELSE logic:
The Case/When logic seems to want to return a value based on testing an expression, I want to perform an action.
The If/Else logic works, but it seems bulky. Is there a simpler way?
Thanks,
--Jim
I *have* tried the "Case When..." statement, but it does not seem to do what I want--I'm looking for something like the VB SELECT CASE block, and the Case/When seems to behave in a fundamentally different way.
Here is pseudocode using IF/ELSE of what I want--However I want to do this *without* IF/ELSE logic:
Code:
IF @variable = 'A'
UPDATE tbl_A set field = 1
Else If @variable = 'B'
UPDATE tbl_B set field = 1
Else If @variable = 'C'
UPDATE tbl_C set field = 1
Else
UPDATE tbl_X set field = 1;
The Case/When logic seems to want to return a value based on testing an expression, I want to perform an action.
The If/Else logic works, but it seems bulky. Is there a simpler way?
Thanks,
--Jim