简体   繁体   English

ORA-00911:字符无效?

[英]ORA-00911: invalid character?

I'm getting the following error: 我收到以下错误:

ORA-00911: invalid character at XDocument doc= Document.Load(crtCommand.ExecuteScalar().ToString());* ORA-00911:XDocument doc = Document.Load(crtCommand.ExecuteScalar()。ToString())处的字符无效; *

With this code: 使用此代码:

 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");
     }
 }

Get rid of the trailing semicolon. 摆脱尾随的分号。

using (OracleCommand crtCommand = new OracleCommand(
    "SELECT dbms_metadata.get_sxml('VIEW','VIEW_TBL_A') FROM dual", conn1))

Oracle doesn't like statement delimiters when passing in a single statement for immediate execution. 当传递单个语句以立即执行时,Oracle不喜欢语句分隔符。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM