LPX-00607 for ora:包含在java中但不包含在sqlplus中

发布于 2024-08-25 18:00:41 字数 1095 浏览 2 评论 0原文

我正在尝试在 Oracle 11g 中执行一些 SQL 查询,但在使用 ora:contains 时遇到问题。我正在使用 Spring 的 JDBC 实现,我的代码生成 sql 语句:

select * 
  from view_name 
 where column_a = ? 
   and column_b = ? 
   and existsNode(xmltype(clob_column), 
                  'record/name [ora:contains(text(), "name1") > 0]', 
                  'xmlns:ora="http://xmlns.oralce.com/xdb"') = 1

显然我已经删除了实际的视图/列名称,但是当我将其复制到 sqlplus 并替换为随机值时,选择会正确执行。当我尝试在我的 DAO 代码中运行它时,我得到了这个堆栈跟踪:(

org.springframework.jdbc.UncatergorizedSQLException: PreparedStatementCallback;
uncatergorizedSQLException for SQL [the big select above]; SQL state [99999]; 
error code [31011]; 
ORA-31011: XML parsing failed.
ORA-19202: Error occured in XML processing
LPX-00607: Invalid reference: 'contains';nested exception is java.sql.SQLException: 
ORA-31011: XML parsing failed
ORA-19202: Error occured in XML processing
LPX-00607: Invalid reference: 'contains'

像这样继续一段时间......)

我认为值得一提的是,我正在使用 Maven,并且我可能缺少一些依赖项为此需要。抱歉,这篇文章太长了,但我想避免信息过多。

感谢您至少花时间阅读本文 =)

-Windle

I am trying to doing some SQL queries out of Oracle 11g and am having issues using ora:contains. I am using Spring's JDBC implementation and my code generates the sql statement:

select * 
  from view_name 
 where column_a = ? 
   and column_b = ? 
   and existsNode(xmltype(clob_column), 
                  'record/name [ora:contains(text(), "name1") > 0]', 
                  'xmlns:ora="http://xmlns.oralce.com/xdb"') = 1

I have removed the actual view / column names obviously, but when I copy that into sqlplus and substitute in random values, the select executes properly. When I try to run it in my DAO code I get this stack trace:

org.springframework.jdbc.UncatergorizedSQLException: PreparedStatementCallback;
uncatergorizedSQLException for SQL [the big select above]; SQL state [99999]; 
error code [31011]; 
ORA-31011: XML parsing failed.
ORA-19202: Error occured in XML processing
LPX-00607: Invalid reference: 'contains';nested exception is java.sql.SQLException: 
ORA-31011: XML parsing failed
ORA-19202: Error occured in XML processing
LPX-00607: Invalid reference: 'contains'

(continues on like this for awhile....)

I think it is worth mentioning that I am using Maven and it is possible I am missing some dependency that is required for this. Sorry the post is so long, but I wanted to err on the side of too much info.

Thanks for taking the time to read this at least =)

-Windle

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

橙味迷妹 2024-09-01 18:00:41

您的名称空间声明中似乎存在拼写错误:

'xmlns:ora="http://xmlns.oralce.com/xdb"'
                            ^^

如果这确实是您的代码中的拼写错误(而不仅仅是您在此处发布的内容),那么修复它也没什么坏处。

You appear to have a spelling mistake in your namespace declaration:

'xmlns:ora="http://xmlns.oralce.com/xdb"'
                            ^^

If that really is a typo in your code (rather than just in your posting here) it can't hurt to fix it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文