sql - why does my nested case statement return a character set mismatch? - Stack Overflow:

The type of a case statement is determined by the first clause in it. In this case, the first clause is a varchar string rather than an nvarchar.

Try this:
UPDATE TableA t
SET t.Last_Col = (CASE WHEN t.First_Col = N'ItemOne'
THEN N'anItemOne'
WHEN t.First_Col = N'ItemTwo'
THEN (CASE WHEN t.Second_Col = N'ItemTwo_A'
THEN N'aSecondItem_A'
ELSE N'aSecondItem'
END)
ELSE N'NoItem'
END );

Wow. Weird. String fields != strings if the field is an NVARCHAR. But slap an N in front of your quoted strings and you're golden.

Slick interface you got there, Oracle.

Labels: ,