rawtohex函数与oracle中的case语句

时间:2015-06-10 08:12:06

标签: oracle

rawtohex(case 
            when ad.AGENT_TYPE in ('ROLE_CUSTOMER_L0',
                                   'ROLE_CUSTOMER_L1',
                                   'ROLE_CUSTOMER_L2') 
            then cinf.STR_CARD_NUMBER 
            else ad.STR_CARD_NUMBER
          ) end as CARD_NUMBER
     ) 

Rawtohex函数无效,导致语法错误

1 个答案:

答案 0 :(得分:1)

你放错了右括号

select to_char(case
         when 'x' = 'x'
         then 'x'
         else 'y')
        end as bla
from dual;

ORA-00905: missing keyword
00905. 00000 -  "missing keyword"
*Cause:    
*Action:
Error at Line: 27 Column: 18

select to_char(case
         when 'x' = 'x'
         then 'x'
         else 'y'
        end) as bla
from dual;

BLA
---
x