Subject Re: [firebird-support] CASE WHEN error
Author Svein Erling Tysvaer
Esra Ozdemir wrote:
> "Invalid token.Dynamic SQL Error.
> SQL error code = -104.
> Token unknown - line 20, char 4.
> when."

That would be the missing comma. I.e.

>hesaplar.hesap_credit
>case when hesaplar.hesap_sec_tablo = 0 then ''P'' Else ''M'' end as ST

is interpreted as

hesaplar.hesap_credit as case

and then Firebird doesn't know what to do with WHEN where it expects a
comma.

If you changed to

hesaplar.hesap_credit,
case when hesaplar.hesap_sec_tablo = 0 then ''P'' Else ''M'' end as ST

it should either succeed or give you another error message.

HTH,
Set