Toad World® Forums

CASE Statement with Concat

Hi. I'm trying to do a case statement where the else clause returns a concat statement. I am getting a missing keyword error. My toad version is 5.1.7.245. Thanks!

CASE WHEN ITEM_TYPE IN ('98', '99', '100','102') THEN 'X'
WHEN AID_TYPE='Q' AND SOURCE_SDESC='T' THEN 'A'
WHEN AID_TYPE='V' AND SOURCE_SDESC='W' THEN 'Y'
WHEN CATEGORY_2='P' THEN 'Z'
ELSE CONCAT(CATEGORY_2, ' ', INST_FUND_DETAIL)

Or I also tried it this way.

CASE WHEN ITEM_TYPE IN ('98', '99', '100','102') THEN 'X'
WHEN AID_TYPE='Q' AND SOURCE_SDESC='T' THEN 'A'
WHEN AID_TYPE='V' AND SOURCE_SDESC='W' THEN 'Y'
WHEN CATEGORY_2='P' THEN 'Z'
ELSE CONCAT(CONCAT(CATEGORY_2, ' '), INST_FUND_DETAIL)

Whoops. Just forgot to end it. I was able to do it doing || instead of Concat. Not sure how to solve this with concat though.