Donnerstag, 2. Juni 2016

ORA-12704: Character Set Mismatch

If you try to compare or union varchar2 with nvarchar2 directly with each other you will get mentioned ORA-12704. Astonishingly enough I did get it under 12c also with following query!
with V
     as (  select 'VARCHAR2_TABLE' as SRC
                , VARCHAR2_ATTRIBUTE as ATTRIBUTE_VALUE
                , count(*) as NUM
                , count(distinct VARCHAR2_ATTRIBUTE) as NUM_DIST_TRACKINGNUMBER
             from VARCHAR2_TABLE
         group by VARCHAR2_ATTRIBUTE)
   , NV
     as (  select 'NVARCHAR2_TABLE' as SRC
                , cast(NVARCHAR2_ATTRIBUTE as varchar2(4000))
                     as ATTRIBUTE_VALUE
                , count(*) as NUM
                , count(distinct VKOR_BESTELLNUMMER) as NUM_DIST_TRACKINGNUMBER
             from NVARCHAR2_TABLE
         group by cast(NVARCHAR2_ATTRIBUTE as varchar2(4000)))
select * from V
union all
select * from NV;
I have no work around so far.

Keine Kommentare:

Kommentar veröffentlichen