ORA-12704: character set mismatch

后端 未结 2 2008
感情败类
感情败类 2020-12-01 23:48

Hell when I do:

select COALESCE (CORP_ID, 0) from crmuser.accounts;

The CORP_ID records which are Null returns 0 but when I do:

<         


        
相关标签:
2条回答
  • 2020-12-02 00:05

    you should do

    select COALESCE (EMAIL, n'NO EMAIL') from crmuser.accounts
    

    to convert the literal to NVARCHAR.

    eg http://sqlfiddle.com/#!4/73929/1 vs http://sqlfiddle.com/#!4/73929/2

    0 讨论(0)
  • 2020-12-02 00:21

    This generic fix works with columns defined as either VARCHAR2 or NVARCHAR2:

    select COALESCE (EMAIL, N'' || 'NO EMAIL') from crmuser.accounts
    

    Just add N'' || before your non-Unicode string constant.

    0 讨论(0)
提交回复
热议问题