Subject Re: [firebird-support] Re: case when .. else ..end
Author Helen Borrie
At 11:16 AM 19/10/2005 +0000, you wrote:
>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

The second one is wrong. If the first one doesn't work then I suspect you
are using either InterBase or Firebird 1.0.x, which don't support case
expressions.

./heLen