ORA-12704:字符集不匹配

版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/gumengkai/article/details/51213537

在使用union all连接时,若A集合中某列为nvarchar2或nvarchar2类型,而B集合中无此列,用
''来代替或者说B集合中此列为varchar2类型,会报字符集不匹配的错误,

如下:

sys@ORCL> select cast('测试' as nvarchar2(10)) t from dual
  2  union all
  3  select '' from dual;
select cast('测试' as nvarchar2(10)) t from dual
       *
ERROR at line 1:
ORA-12704: character set mismatch

解决方法

1.to_char()

sys@ORCL> select to_char(cast('测试' as nvarchar2(10))) t from dual
  2  union all
  3  select '' from dual;

2.用N',N''就是讲''转换为unicode编码

sys@ORCL> select '中国','China',cast('中国' as nvarchar2(10)) T from dual 
union all select '美国','USA',N'' from dual;
展开阅读全文
博主设置当前文章不允许评论。

ORA-12704: 字符集匹配

06-27

不知道什么问题引起的。没找到解决办法rnrn“/”应用程序中的服务器错误。rn--------------------------------------------------------------------------------rnrnORA-12704: 字符集不匹配rnrn说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 rnrn异常详细信息: System.Data.OracleClient.OracleException: ORA-12704: 字符集不匹配rnrnrn源错误: rnrn执行当前 Web 请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。 rnrn堆栈跟踪: rnrnrn[OracleException (0x80131938): ORA-12704: 字符集不匹配rn]rn System.Data.OracleClient.OracleConnection.CheckError(OciErrorHandle errorHandle, Int32 rc) +203rn System.Data.OracleClient.OracleCommand.Execute(OciStatementHandle statementHandle, CommandBehavior behavior, Boolean needRowid, OciRowidDescriptor& rowidDescriptor, ArrayList& resultParameterOrdinals) +1021rn System.Data.OracleClient.OracleCommand.Execute(OciStatementHandle statementHandle, CommandBehavior behavior, ArrayList& resultParameterOrdinals) +25rn System.Data.OracleClient.OracleCommand.ExecuteReader(CommandBehavior behavior) +142rn System.Data.OracleClient.OracleCommand.ExecuteDbDataReader(CommandBehavior behavior) +4rn System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) +7rn System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +141rn System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +137rn System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +83rn System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1770rn System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +17rn System.Web.UI.WebControls.DataBoundControl.PerformSelect() +149rn System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70rn System.Web.UI.WebControls.GridView.DataBind() +4rn System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82rn System.Web.UI.WebControls.GridView.OnPreRender(EventArgs e) +24rn System.Web.UI.Control.PreRenderRecursiveInternal() +86rn System.Web.UI.Control.PreRenderRecursiveInternal() +170rn System.Web.UI.Control.PreRenderRecursiveInternal() +170rn System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2041rn rn 论坛

内置字符集匹配

05-25

<div>n <span style="font-size:16px;"><span><span style="font-size:20px;color:#FF0000;"><strong><span>课程亮点:</span></strong></span></span></span> n</div>n<div style="font-size:16px;">n <span style="color:#424242;"><span style="background-color:#FFFAA5;">笔记加案例详细讲解Linux知识!!!提供详细的笔记作为辅助工具,<span style="color:#41AD1C;">200多条笔记帮助学员快速掌握Linux命令行150多个知识点</span></span></span> n</div>n<p style="font-size:16px;">n <span style="font-size:14px;"><span><span style="background-color:#FFFFFF;"><span style="color:#424242;"><br /></span></span></span></span> n</p>n<div>n <div>n <span style="font-size:16px;color:#E53333;"><span style="color:#E53333;"><strong><span style="background-color:#FFFFFF;color:#E53333;"><strong><span style="font-size:18px;">课程内容:</span></strong></span></strong></span></span> n </div>n <p>n </p><ol><li>n 文本搜索:通过指定搜索范围、指定匹配范围、指定字符集,再结合正则表达式可进行准确内容的搜索,学习本内容后学员可根据实际业务场景设置相关搜索参数n </li>n <li>n 文本处理:行或者指定字段排序、去重复行、文本剪切、文本合并、文件比较、字符替换,学习本内容后学员可熟练掌握文本处理相关命令<br /></li>n </ol></div>n<div>n <span style="font-size:16px;"><span><span style="color:#FF0000;"><strong><span style="font-size:18px;">课程特色:</span></strong></span></span></span> n</div>n<ol><li>n <div>n 笔记Linux命令:用200条笔记串连所有知识点,让学员从一点一滴积累,学习过程无压力n </div>n </li>n <li>n <div>n 笔记标题采用关键字标识法,帮助学员更加容易记住知识点n </div>n </li>n <li>n <div>n 笔记以超链接形式让知识点关联起来,形式知识体系n </div>n </li>n <li>n <p>n 采用先概念后实例再应用方式,知识点深入浅出n </p>n </li>n <li>n <div>n <span style="color:#00B050;"><strong>提供授课内容笔记作为课后复习以及工作备查工具</strong></span> n </div>n </li>n</ol><p>n <span style="font-size:16px;"><span><span style="color:#00B050;"><strong><strong><span style="font-size:18px;">部分图标(电脑PC端查看):</span></strong></strong></span></span></span> n</p>n<p>n <span style="font-size:16px;"><span><span style="color:#00B050;"><strong><strong><span style="font-size:18px;"><img src="https://img-bss.csdn.net/201905251422537848.png" alt="" /><img src="https://img-bss.csdn.net/201905251422583852.png" alt="" /><img src="https://img-bss.csdn.net/201905251423033772.png" alt="" /><img src="https://img-bss.csdn.net/201905251423091874.png" alt="" /><br /></span></strong></strong></span></span></span> n</p>

没有更多推荐了,返回首页