0

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:
4

1 に答える 1

2

文字列を二重引用符ではなく一重引用符で囲みます。二重引用符は識別子用です

'NONLOOP PROMOTIONAL'
于 2013-01-16T15:21:58.370 に答える