本文介绍了ORA-00911:字符无效?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我遇到以下错误:
使用以下代码:
using (OracleConnection conn1 = new OracleConnection(oradb1))
{
conn1.Open();
using (OracleCommand crtCommand
= new OracleCommand("SELECT dbms_metadata.get_sxml('VIEW','VIEW_TBL_A') FROM dual;", conn1))
{
XDocument doc = XDocument.Load(crtCommand.ExecuteScalar().ToString());
XNamespace ns = "http://xmlns.oracle.com/ku";
if (doc.Descendants(ns + "COL_LIST_ITEM").Any(c => c.Attributes().Any()))
MessageBox.Show("COL_LIST has value");
else
MessageBox.Show("COL_LIST has no value");
}
}
推荐答案
摆脱尾随的分号.
using (OracleCommand crtCommand = new OracleCommand(
"SELECT dbms_metadata.get_sxml('VIEW','VIEW_TBL_A') FROM dual", conn1))
在传递单个语句以立即执行时,Oracle不喜欢语句分隔符.
Oracle doesn't like statement delimiters when passing in a single statement for immediate execution.
这篇关于ORA-00911:字符无效?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!