Subject Re: case when .. else ..end
Author polash26
ERROR:

/**************
The next statement causes the following error:

Invalid token.
Dynamic SQL Error.
SQL error code = -104.
Token unknown - line 11, char 8.
when.
*********************************/

I tried following way
FOR SELECT
MP.RoleID,
case
when MP.RoleID = -1 then 'All Users'
when MP.RoleID = -2 then 'Superuser'
when MP.RoleID = -3 then 'Unauthenticated Users'
else R.RoleName
end
FROM AAA MP

and also using double quote,

FOR SELECT
MP.RoleID,
case
when MP.RoleID = -1 then "All Users"
when MP.RoleID = -2 then "Superuser"
when MP.RoleID = -3 then "Unauthenticated Users"
else R.RoleName
end
FROM AAA MP