CASE文の書き方に問題あり。助けてください
insert into CDR(rts,smscid,count,statusflag,operator,identifier)
select trunc(rts),smscid,statusflag,operator,
(case when smscid='BPL-MUM' and operator='BPL' and is_number(replace(replace(replace(senderid, 'DM-',''), 'LM-',''),'BT-',''))=0 THEN "LOOP TRANSACTIONAL"
when smscid='BPL-MUM' and operator!='BPL' and is_number(replace(replace(replace(senderid, 'DM-',''), 'LM-',''),'BT-',''))=0 THEN "NONLOOP TRANSACTIONAL"
When Smscid='BPL-MUM' And Operator='BPL' And Is_Number(Replace(Replace(Replace(Senderid, 'DM-',''), 'LM-',''),'BT-',''))!=0 THEN "LOOP PROMOTIONAL"
when smscid='BPL-MUM' and operator!='BPL' and is_number(replace(replace(replace(senderid, 'DM-',''), 'LM-',''),'BT-',''))!=0 THEN "NONLOOP PROMOTIONAL"
END),sum(count)
From Mis_Summary_Dn Where Rts Between '26-dec-2012' And '27-dec-2012' And Statusflag='SUCCESS' Group By Trunc(Rts),Smscid,Statusflag,Operator;
次のようなエラーが発生しています
SQL Error: ORA-00904: "NONLOOP PROMOTIONAL": invalid identifier
00904. 00000 - "%s: invalid identifier"
*Cause:
*Action: