Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ORA-12704: character set mismatch

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:

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

I get an error:

ORA-12704: character set mismatch

The EMAIL field in NVARCHAR2(30). Is is My Datatype and if so What should I do to return default Values?

like image 921
Stanley Mungai Avatar asked Apr 12 '13 09:04

Stanley Mungai


1 Answers

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

like image 104
DazzaL Avatar answered Sep 27 '22 22:09

DazzaL