ORA-12704:character set mismatch

          SELECT CUS, CARTONNO, STYLENO, (CASE WHEN I49GTYP = 'Others' THEN I49GITM ELSE B21JCUSNAM END) STYLEDESC, COLOR, SIZ, QTY, SIZRUN, SEQ FROM
          (
            SELECT I49GCUS CUS, I49GCTNNUM CARTONNO,
            TO_CHAR(CASE WHEN I49GTYP = 'Others' THEN NULL ELSE SUBSTR(I49GITM,1,14) END ) STYLENO,
            TO_CHAR(CASE WHEN I49GTYP = 'Others' THEN '' ELSE TO_CHAR(SUBSTR(I49GITM,15,3)) END ) COLOR,
            TO_CHAR(CASE WHEN I49GTYP = 'Others' THEN '' ELSE TO_CHAR(SUBSTR(I49GITM,18)) END ) SIZ,
            (SELECT B21SIZRUN FROM ZTB21 WHERE B21PLUNUM = SUBSTR(I49GITM,1,14) AND B21CURFLG ='Y') SIZRUN,
            I49GQTY QTY , CASE WHEN I49GTYP = 'Others' THEN 2 ELSE 1 END SEQ, I49GITM, I49GTYP
            FROM ZTI49G, (
SELECT DISTINCT F14CCOMCOD,F14CPLFRMSTO,F14CPLNUM,F14CPLVER FROM ZTF14A, ZTF14C
WHERE F14ACOMCOD = F14CCOMCOD  AND F14AFRNCOD = F14CFRNCOD AND F14APNNUM = F14CPNNUM
AND F14APNVER = F14CPNVER AND F14ALINNUM = F14CALINNUM AND F14ATYP = 'PL'
AND (F14ACOMCOD, F14AFRNCOD, F14APNNUM, F14APNVER) IN (('ZZ','GZFR','PN1200019',1)))
WHERE I49GCOMCOD = F14CCOMCOD AND I49GFRMSTOCOD = F14CPLFRMSTO AND I49GPLNUM = F14CPLNUM AND I49GPLVER = F14CPLVER
), ( SELECT B21JPLUNUM, B21JCUSNAM FROM ZTB21J, ZTM100 WHERE B21JMKTCOD(+) = M100ORDMKT AND M100FRNCOD = 'GZFR' )
          WHERE B21JPLUNUM(+) = STYLENO

 

经查看发现case中满足条件后输出的列B21JCUSNAM为NVARCHAR2类型的,试着将这列转换为TO_CHAR(B21JCUSNAM)问题就可以解决了。

你可能感兴趣的:(ORA-12704:character set mismatch)