本文主要是介绍Oracl查询报错:ORA-29275: 部分多字节字符,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
报错描述
--使用oracl的sql查询时候,此sql无误:SELECT DISTINCT MS_BRDA.MZHM as patientId,MS_BRDA.BRXM as name,CASEWHEN MS_BRDA.BRXB = 1 THEN '男'WHEN MS_BRDA.BRXB = 2 THEN '女'ELSE '未知'END AS gender,MS_GHMX.GHSJ as arrivalTime,MS_BRDA.CSNY as birthday,MS_BRDA.HKDZ as address,MS_GHMX.KSDM as deptCodeFROM MS_BRDA@PORTAL56_HISLEFT JOIN MS_GHMX@PORTAL56_HIS ON MS_GHMX.BRID = MS_BRDA.BRID
--但是关联其他表就会报错(ORA-29275: 部分多字节字符):SELECT DISTINCT MS_BRDA.MZHM as patientId,MS_BRDA.BRXM as name,CASEWHEN MS_BRDA.BRXB = 1 THEN '男'WHEN MS_BRDA.BRXB = 2 THEN '女'ELSE '未知'END AS gender,MS_GHMX.GHSJ as arrivalTime,MS_BRDA.CSNY as birthday,MS_BRDA.HKDZ as address,MS_GHMX.KSDM as deptCodeFROM MS_BRDA@PORTAL56_HISLEFT JOIN MS_GHMX@PORTAL56_HIS ON MS_GHMX.BRID = MS_BRDA.BRIDLEFT JOIN ECIS_YJFZ ON MS_BRDA.BRID = ECIS_YJFZ.BRID
排查思路
定位问题为字符格式不一致导致
SELECT * FROM NLS_DATABASE_PARAMETERS WHERE PARAMETER = 'NLS_CHARACTERSET';
--his是ZHS16GBK
--ecis是AL32UTF8
这篇关于Oracl查询报错:ORA-29275: 部分多字节字符的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!